[PROJ] Migrating to PROJ-9

Nicolas Bellaiche nicolas.bellaiche at ign.fr
Tue May 30 10:46:49 PDT 2023


Hi all, 

Is there any reason why the deprecated syntax "+init=" doesn't give the same result as the new syntax? 



echo 3356123.5400 1303218.3090 5247430.6050 | ./cs2cs IGNF:RGR92 +to IGNF:REUN47 

3353420.95 1304075.02 5248935.14 







echo 3356123.5400 1303218.3090 5247430.6050 | ./cs2cs +init=IGNF:RGR92 +to +init=IGNF:REUN47 

3356123.54 1303218.31 5247430.61 

Thanks in advance for your answers, 

N. 

De: "Even Rouault" <even.rouault at spatialys.com> 
À: "proj" <proj at lists.osgeo.org> 
Envoyé: Vendredi 26 Mai 2023 21:50:27 
Objet: Re: [PROJ] Migrating to PROJ-9 



Ah, and you should avoid using the "+init=" prefix. This is a deprecated legacy syntax that doesn't enforce axis order of the CRS definition (without practical consequence for IGNF: CRS since they use "GIS friendly" axis order) 


To help debugging this, please provide the output of: 


PROJ_DEBUG=3 projinfo -s IGNF:LAMB93 -t IGNF:RGF93 -o PROJ 


On my system I get: 


pj_open_lib(proj.ini): call fopen(/home/even/proj/install-proj-master/share/proj/proj.ini) - succeeded 
pj_open_lib(proj.db): call fopen(/home/even/proj/install-proj-master/share/proj/proj.db) - succeeded 
Candidate operations found: 1 
------------------------------------- 
Operation No. 1: 

unknown id, Inverse of LAMBERT-93 + Conversion from RGF93 geographiques (dms) to RGF93 cartesiennes geocentriques, 0 m, World 

PROJ string: 
+proj=pipeline 
+step +inv +proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=44 +lat_2=49 +x_0=700000 
+y_0=6600000 +ellps=GRS80 
+step +proj=cart +ellps=GRS80 

Le 26/05/2023 à 21:46, Even Rouault a écrit : 




Hi, 

I get the expected 4070327.25 166078.93 4891298.61 result with proj 6.0.0, 7.2.1, 9.2.0 and master 

There's no grid involved in this operation, just inverse LCC projection on the RGF93 datum 

I also tried to reproduce your issue if the PROJ < 6 IGNF file is found in the PROJ resource path(s) (non nominal situation - this file is not needed any more, and will generally lead to suboptimal results. Its content is included in the proj.db file), but even with that I get the expected result. So no idea why you get wrong results 


Even 


Le 26/05/2023 à 20:54, Nicolas Bellaiche a écrit : 

BQ_BEGIN

Hi all, 

I'm migrating my C++ code from PROJ4 to PROJ9 and I meet a worrying issue with the computation. Some of my regress tests don't pass so I've tested with cs2cs and gets the same difference: 



PROJ4 

echo 652760.73700000 7033791.24300000 43 .64200000 | cs2cs +init=IGNF:LAMB93 +to +init=IGNF:RGF93: 

4070327.25 166078.93 4891298.61 




PROJ7 or PROJ9 

echo 652760.73700000 7033791.24300000 43 .64200000 | cs2cs +init=IGNF:LAMB93 +to +init=IGNF:RGF93: 

4070355.05 166080.07 4891332.24 






I suspect that PROJ7 and PROJ9 don't read properly the geoid file but I'm not sure. Someone can help me tracking and fixing this problem? 

Thanks, 

Nicolas Bellaiche 
Institut Géographique National France 

_______________________________________________
PROJ mailing list [ mailto:PROJ at lists.osgeo.org | PROJ at lists.osgeo.org ] [ https://lists.osgeo.org/mailman/listinfo/proj | https://lists.osgeo.org/mailman/listinfo/proj ] 



-- [ http://www.spatialys.com/ | http://www.spatialys.com ] My software is free, but my time generally not. 

_______________________________________________
PROJ mailing list [ mailto:PROJ at lists.osgeo.org | PROJ at lists.osgeo.org ] [ https://lists.osgeo.org/mailman/listinfo/proj | https://lists.osgeo.org/mailman/listinfo/proj ] 

BQ_END

-- [ http://www.spatialys.com/ | http://www.spatialys.com ] My software is free, but my time generally not. 

_______________________________________________ 
PROJ mailing list 
PROJ at lists.osgeo.org 
https://lists.osgeo.org/mailman/listinfo/proj 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20230530/1c077ede/attachment-0001.htm>


More information about the PROJ mailing list