[Proj] Proj4-API - pj_init_plus returns a NULL pointer for my ESRI projection string
Markus Eberhard
markus.eberhard at InUnum.li
Fri May 11 02:52:39 EST 2012
Am 10.05.2012 21:10, schrieb Markus Eberhard:
> 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
>
>
>
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj
>
The projection string defined in the ESRI projection configuration file
seems to make problems - with the string defined in the ESRI projection
config file
+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
I get allways a NULL pointer (-> function pj_init_plus).
http://cs2cs.mygeodata.eu uses the following string for the same
projection (CH1903 / LV03 - SRID=21781)
+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +x_0=600000 +y_0=200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs
That projection string leads to a valid projection object. Why there are
different projection strings? http://cs2cs.mygeodata.eu is also based
on Proj4!
Best regards,
Markus
More information about the Proj
mailing list