[FWTools] Proj.4 pj_init_plus issue

BENOIT Jean-Pierre Jean-Pierre.BENOIT at irsn.fr
Mon Jan 14 12:49:06 EST 2008


 

-----Message d'origine-----
De : Frank Warmerdam [mailto:warmerdam at pobox.com] 
Envoyé : lundi 14 janvier 2008 18:31
À : BENOIT Jean-Pierre
Cc : fwtools at lists.maptools.org
Objet : Re: [FWTools] Proj.4 pj_init_plus issue

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

OK, It works.

I apologize not reading the few lines on http://fwtools.maptools.org/windows-main.html

Thanks a lot.
JPB



More information about the FWTools mailing list