[Proj] Proj4-API - pj_init_plus returns a NULL pointer for my ESRI projection string

Markus Eberhard markus.eberhard at InUnum.li
Thu May 10 14:10:32 EST 2012


Am 10.05.2012 16:56, schrieb Frank Warmerdam:
> On 12-05-10 12:43 AM, Markus Eberhard wrote:
>> Hi *,
>> I'm using the Proj4-API. Currently I've problems with the following C++
>> API call:
>>        projPJ projPixel = pj_init_plus( "+init=esri:21781" );
>> The called function returns a NULL pointer.
>>
>> Strange, the following similar function call works for me
>>       projPJ projPixel = pj_init_plus( "+init=world:CH1903" );
>>
>> Thanks for your help.
> Markus,
>
> Did you confirm that 21781 is defined in the esri file?  I imagine it
> is as I see:
> # CH1903 / LV03
> <21781>  +proj=omerc +lat_0=46.95240555555556 +lonc=7.439583333333333 +alpha=90
> +k=1 +x_0=600000 +y_0=200000 +ellps=bessel +units=m +no_defs  no_defs<>
>
> in mine.
>
> The next thing I'd do is set the PROJ_DEBUG environment variable to 4 and
> try again.  There should be some reporting to stderr about what file is
> opened.
>
> eg.
>
> warmerda at gdal65[10]% cs2cs +init=esri:21781
> pj_open_lib(esri): call fopen(/home/warmerda/bld/share/proj/esri) - succeeded
>
> pj_open_lib(proj_def.dat): call
> fopen(/home/warmerda/bld/share/proj/proj_def.dat) - succeeded
>
> If that doesn't give a clue you may need to debug into things to figure it
> out.
>
> Best regards,

Hi Frank,
thanks for your hints. The ESRI projection configuration file is opened 
successfully on my system:

pj_open_lib(esri): call fopen(/usr/share/proj/esri) - succeeded
pj_open_lib(proj_def.dat): call fopen(/usr/share/proj/proj_def.dat) - succeeded

Additionaly I've tried to set the projection config string directly 
using the following function call:

projPJ projPixel = pj_init_plus( "+proj=omerc +lat_0=46.95240555555556 +lonc=7.439583333333333 +alpha=90 +k=1 +x_0=600000 +y_0=200000 +ellps=bessel +units=m +no_defs" );

-> same result: NULL pointer

I'll try to debug the proj library tomorrow - may be you have an 
additional tip for me?

Thanks
Markus





More information about the Proj mailing list