[Gdal-dev] Re: datum shift with PROJ4 in GDAL

Frank Warmerdam warmerdam at pobox.com
Wed Apr 30 13:22:43 EDT 2003


Brian Marchand wrote:
> Frank,
> 
> Thanks for the reply. I had performed the steps you mentioned when
> testing the command line versions. However, I use GDAL and therefore
> PROJ.4 in an application that is delivered to multiple users. I didn't
> want to set an environment variable on the user's (windows) machine so I
> was looking for a programmatic way to tell PROJ.4 where to look for
> these files. 
> 
> When I was poking around in the PROJ4 code I found the pj_set_finder
> function that allows you to pass in a pointer to a function that
> performs this task.  I was wondering if there was an interface in GDAL
> that passed this capability on.  I didn't see one.
> 
> What I ended up doing was copy some of your code that loads PROJ4
> function symbols from the DLL so I can get a pointer to the
> pj_set_finder function.
> 
> It looks something like this;
> 
> static void (*my_pj_set_finder)( const char *(*)(const char *) ); 
> my_pj_set_finder = (void (*)( const char* (*)(const char*)) )
> 	CPLGetSymbol("proj.dll", "pj_set_finder" );
> if( my_pj_set_finder )
> {
> 	// call the function
> }
> 
> Anyways, it seems to work fine. If there is a better way to do this I
> would definitely appreciate hearing about it.

Brian,

I understand your point.  Currently GDAL doesn't necessarily know where
the PROJ.4 data files were installed so it is hard for it to point the
finder appropriately.  Could you file this request in bugzilla against
GDAL?  I will look into a smoother method of integration.

This might includes having GDAL force PROJ.4 to use CPLFindFile() with a
particular domain (ie. "proj") so that applications can use the CPL finder
logic to control where to look.  Furthermore, I might make it so that GDAL
looks in the main GDAL data directory for PROJ.4 support files, so when
preparing a distribution people can dump all the GDAL support data files, and
PROJ.4 support data files all in one place and have them be found.

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





More information about the Gdal-dev mailing list