[OSRS-PROJ] NTv2 Datum transformation

Brent Fraser bfraser at geoanalytic.com
Tue Nov 25 15:59:04 EST 2003


Frank,

  Many thanks for the info.    I ran into a nasty problem related I think to
the linked gridlist and pj_gridinfo_init.

My solution/work-around was to set the PROJ_LIB environment variable in
Windows to:
        PROJ_LIB=C:/proj/nad
instead of
        PROJ_LIB=/proj/nad

but I don't know why that works.  The first datum transformation my software
requested worked, but the second failed due to an fopen failure in
pj_open_lib when trying to open NTv2_0.gsb

I'm reluctant to debug it due to time constraints and the fact that I'm not
familiar enough with the datum portion of Proj, but I thought I would
mention it in case others had a similar problem.

Please note that the problem does NOT exist in cs2cs.exe (it works just fine
for NTv2 datum conversions.)

Thanks again,
Brent

----- Original Message -----
From: "Frank Warmerdam" <warmerdam at pobox.com>
To: <osrs-proj at remotesensing.org>
Sent: Thursday, November 20, 2003 12:38 PM
Subject: Re: [OSRS-PROJ] NTv2 Datum transformation


> Brent Fraser wrote:
> > I get it now.
> >
> > The way I set up my functions was to define a "from" and "to" coordinate
> > system definition (here's my VB):
> >
> >     sToCSD = "+proj=latlong +datum=NAD27"
> >     hToCSD = GPinitializeProjection(sToCSD) ' a VB friendly wrapper to
> > pj_init
> >
> >     sFrCSD = "+proj=latlong +datum=NAD83"
> >     hFrCSD = GPinitializeProjection(sFrCSD)' a VB friendly wrapper to
> > pj_init
> >
> >     status = GPdatum2datum(hFrCSD, hToCSD, -122, 49, newLon, newLat) ' a
VB
> > friendly wrapper to pj_transform
> >
> >
> > It never occured to me to simply add the nadgrids keyword to the NAD27
> > coordinate system def:
> >     sToCSD = "+proj=latlong +datum=NAD27 +nadgrids=NTv2_0.gsb"
>
> Brent,
>
> I would add that you should not include a +datum and a +nadgrids clause
> as it becomes ambiguous whether the +nadgrids from the +datum will be used
> or the standalone one you include. So the better forumulation would
> be "+proj=latlong +ellps=clrk66 +nadgrids=NTv2_0.gsb".
>
> 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.

----------------------------------------
PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.



More information about the Proj mailing list