[FWTools] Proj.4 pj_init_plus issue
Frank Warmerdam
warmerdam at pobox.com
Mon Jan 14 12:30:46 EST 2008
BENOIT Jean-Pierre wrote:
> Hi all,
>
> I have installed FWTools2.0.4-win32 version and I try to run the
> following code :
>
> ……
>
> const char *src_args = "+init=epsg:4326" ;
>
> projPJ src_proj;
>
> if (!(src_proj = pj_init_plus(src_args))) {
>
> printf( "Projection initialization failed.\n" );
>
> exit(1);
>
> }
>
> ……
>
>
>
> Unfortunately, I obtain my error message: “Projection initialization
> failed”.
>
> The same code execute perfectly on Linux with proj.4 V4.6.0.
>
> Could anyone give me an answer on this simple question ?
JPB,
Did you run your program from the FWTools shell? Finding the "epsg"
init file depends on having the PROJ_LIB environment variable set properly.
This is done automatically when the FWTools shell is launched but if you want
to run stuff from your own program you either need to pre-set this environment
variable or call pj_set_searchpath():
void pj_set_searchpath ( int count, const char **path );
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 | President OSGeo, http://osgeo.org
More information about the FWTools
mailing list