[PROJ] Bug in unit conversion using cs2cs and transformations from registries?

Xavier Collilieux xavier.collilieux at ensg.eu
Tue Aug 4 07:56:19 PDT 2020


Dear all,

I apologize if this problem is known or if I don't use the command cs2cs correctly. I have experimented a unit conversion problem when transforming coordinates from WGS84 geographic coordinate system to NTF geographic (Paris meridian) coordinate system using cs2cs.

Using cs2cs:
------------
version 7.1.0
- $ echo 43.97942110 5.77338693  0.0 | cs2cs EPSG:4326 IGNF:NTFP  -f %.8f
Result: 3.43669113    43.97940959 0.00000000
The right result (IGN code) is: 3.81854570 48.86601066
Here the angle unit conversion is missing. Indeed:
echo 3.43669113      43.97940959 | cct -d 10 +proj=unitconvert +xy_in=deg +xy_out=grad
Result: 3.8185457000  48.8660106556           inf           inf

Proposed proj string from projinfo:
-----------------------------------
If launched, the proj string proposed by the following command "projinfo -s EPSG:4326 -t IGNF:NTFP" gives the right result in the right unit.
echo 43.97942110 5.77338693 0.0 | cct -d 8 +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=push +v_3 +step +proj=cart +ellps=WGS84 +step +proj=helmert +x=168 +y=60 +z=-320 +step +inv +proj=cart +ellps=clrk80ign +step +proj=pop +v_3 +step +proj=longlat +ellps=clrk80ign +pm=paris +step +proj=unitconvert +xy_in=rad +xy_out=grad
Result: 3.81854570    48.86601066    0.00000000           inf

I hope that it helps. Do I use the cs2cs command in the right way?

Thank you,
Best regards,

- Xavier

PS: using cs2cs in version 6.3.2, I have also faced coordinate order problem. But I guess it is a known result
The cs2cs command does not recognize the coordinate order:
- $ echo 43.97942110 5.77338693 0.0 | cs2cs +init=EPSG:4326 +to +init=IGNF:NTFP  -f %.8f
Result: 41.64152849     5.77099039 0.00000000
This is the wrong result. When putting the longitude first:
- $ echo 5.77338693 43.97942110 0.0 | cs2cs +init=EPSG:4326 +to +init=IGNF:NTFP  -f %.8f
I got 3.43669113      43.97940959 0.00000000
The same unit conversion problem as in new version 7.3.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20200804/fac65f79/attachment.html>


More information about the PROJ mailing list