[Proj] converting WGS84 to NAD27

Tamas Szekeres szekerest at gmail.com
Sun Oct 4 17:43:16 EST 2009


Anna,

You should probably install those 'datum shift grid files' as per
http://trac.osgeo.org/proj/, and set up their location in the PROJ_LIB
environment setting.
In case if you're on Windows the files are already included in the
pre-compiled packages available from here: http://vbkto.dyndns.org:1280/sdk/
The files are located in the /bin/proj/SHARE subdirectory.

Best regards,

Tamas



2009/10/5 Anna Hentzel <wibge at gmail.com>

> Hi,
>
> I'm trying to convert WGS84 coordinates to UTM and NAD27. I'm using
> the route-me library, which is a thin wrapper on proj4. It just
> creates the PJ objects using pj_init_plus on the strings, and calls
> pg_transform. The transformation to UTM works correctly, but the NAD27
> transformation doesn't change the coordinates. Does anyone know what I
> might be doing wrong?
>
> CLLocationCoordinate2D coord = {60, -119};
> int zone = ((coord.longitude + 186) / 6);
>
> RMProjection* latLonProj = [[RMProjection alloc]
> initWithString:@"+proj=latlong +ellps=WGS84 +datum=WGS84"];
> RMProjection* utmProj = [[RMProjection alloc] initWithString:
> [NSString stringWithFormat:@"+proj=utm +zone=%d +ellps=WGS84", zone]];
>
> RMTransform* trans = [[RMTransform alloc] initFrom:latLonProj To:utmProj];
>
> CLLocationCoordinate2D transCoord = [trans projectForward:coord AtZoom:9];
> NSLog(@"UTM Coord %f, %f %d" , transCoord.latitude, transCoord.longitude,
> zone);
>
> RMProjection* nad27Proj = [[RMProjection alloc]
> initWithString:@"+proj=latlong +ellps=WGS84 +datum=NAD27 +no_defs"];
> trans = [[RMTransform alloc] initFrom:latLonProj To:nad27Proj];
> transCoord = [trans projectForward:coord AtZoom:9];
> NSLog(@"NAD27 Coord %f, %f" , transCoord.latitude, transCoord.longitude);
>
> **output**
> UTM Coord 6653097.435298, 388455.958023 11
> NAD27 Coord 60.000000, -119.000000
>
>
> Thanks,
> Anna
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/proj/attachments/20091005/81047ef0/attachment.htm 


More information about the Proj mailing list