[OSRS-PROJ] Using NAD27/NAD83 datum in the DLL

Frank Warmerdam warmerdam at pobox.com
Mon Apr 16 09:22:58 EDT 2001


Bart Adriaanse wrote:
> 
> With some help earlier from Frank i compiled the DLL for windows and i am
> using the pj_transform to do the coordinate transformations, it works very
> well sofar !
> 
> Now how would i go about using NAD in this scenario, i suppose i will need
> to call nad_init to read the NAD data file but can i have both of them
> loaded at the same ? and would this be sufficient to be able to convert like
> wgs84 to nad83 just by specifying the datum name in pj_init ?
> 
> Any hints would be greatly appreciated,
> 
> Sorry if this is documented someplace, i tried, but could not find it,

Bart, 

Since you are using pj_transform() it should be easier than that.  You 
should just need to include the datum definition in your coordinate system
definition.  For instance "+proj=utm +zone=11 +datum=NAD27".  This will cause
pj_transform() to load the "nad27" datum shift file for shifts from nad27
to nad83 or vice versa.  

The +datum switch just expands into a definition like
"+nadgrids=conus +ellps=clrk66" so if you want to use other datum shift files,
such as the various state level files, alaska, Puerto Rico and so forth, you
will need to use more specific +nadgrids directives. 

eg. 

+proj=utm +zone=11 +nadgrids=hawaii +ellps=clrk66

The other issue is ensuring the files are found.  A default unix installation
puts the various support files in /usr/local/share/proj but on Windows or
in custom situations you may need to hack pj_open_lib.c to look in your
desired directory.  This can be done by modification of the code, or by
setting the PROJ_LIB environment variable. 

I hope this helps. 

Best regards,

---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent
----------------------------------------
PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.



More information about the Proj mailing list