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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Xavier Collilieux
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

_______________________________________________
PROJ mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Bug in unit conversion using cs2cs and transformations from registries?

Even Rouault-2

Hi,

 

> 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

 

For a geographic CRS, cs2cs will always output (and expect input) geographic coordinates in decimal degrees, whatever the unit of the coordinate system. This is a legacy behaviour, from a time where CRS definitions in catalogs didn't include the unit.

 

> 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:

 

Yes, here this is another behaviour when using +init=EPSG:XXX or +init=IGNF:XXXX you use the legacy behaviour that wasn't compliant with the axis order of the authority, and assumed longitude, latitude for geographic CRS. When using EPSG:XXXX or IGNF:XXXX instead, the axis order is respected.

 

Perhaps for the EPSG:XXX or IGNF:XXXX syntax we should also use the unit of the coordinate systems instead of always degrees, but this mostly affects only those NTF based systems...

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
PROJ mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Bug in unit conversion using cs2cs and transformations from registries?

Even Rouault-2

Arg wrong list...

 

---------- Forwarded Message ----------

 

Subject: Re: [gdal-dev] [PROJ] Bug in unit conversion using cs2cs and transformations from registries?

Date: mercredi 5 août 2020, 12:52:14 CEST

From: Even Rouault <[hidden email]>

To: Xavier Collilieux <[hidden email]>

CC: [hidden email]

 

(Adding back the list in CC)

 

>

> Thank you for your quick reply and valuable comments. I should have read the

> documentation more deeply, this is indeed written in the documentation of

> cs2cs at the end but I was so sure that cs2cs behaves as projinfo would

> tell that I missed it. * ***** ***** ** ** ***** ******* **** ***** ** ***

> **** **** *** ************** **** ******** lists.

>

> Another questions, I did not find the answer in the documentation. In case

> of multiple available transformations, do I have a way with cs2cs to tell

> the one I want please? For example "projinfo -s EPSG:4326 -t ESRI:102586"

> provides two output transformations. Do I have the possibility to tell to

> cs2cs that I want the second one? If said differently, instead of giving

> input and ouput crs to cs2cs, can I provide only the transformation name or

> provide the transformation name in addition to the input and output CRS?

> Here "Inverse of NTF to WGS 84 (1) + NTF_Lambert_Zone_II" for example, the

> second field I got using --summary option (= WKT2 CONCATENATEDOPERATION

> name).

 

You have to use cct with the PROJ pipeline emitted by projinfo to control precisely which

transformation you want to use

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com

 

-----------------------------------------

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
PROJ mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Bug in unit conversion using cs2cs and transformations from registries?

Xavier Collilieux

Dear Even,

Thank you for your prompt reply.

And congratulations to all developers for this software,

Best regards,

-          Xavier

 

De : Even Rouault [mailto:[hidden email]]
Envoyé : mercredi 5 août 2020 13:25
À : Xavier Collilieux
Cc : [hidden email]
Objet : Re: [PROJ] Bug in unit conversion using cs2cs and transformations from registries?

 

Arg wrong list...

 

---------- Forwarded Message ----------

 

Subject: Re: [gdal-dev] [PROJ] Bug in unit conversion using cs2cs and transformations from registries?

Date: mercredi 5 août 2020, 12:52:14 CEST

From: Even Rouault <[hidden email]>

To: Xavier Collilieux <[hidden email]>

CC: [hidden email]

 

(Adding back the list in CC)

 

>

> Thank you for your quick reply and valuable comments. I should have read the

> documentation more deeply, this is indeed written in the documentation of

> cs2cs at the end but I was so sure that cs2cs behaves as projinfo would

> tell that I missed it. * ***** ***** ** ** ***** ******* **** ***** ** ***

> **** **** *** ************** **** ******** lists.

>

> Another questions, I did not find the answer in the documentation. In case

> of multiple available transformations, do I have a way with cs2cs to tell

> the one I want please? For example "projinfo -s EPSG:4326 -t ESRI:102586"

> provides two output transformations. Do I have the possibility to tell to

> cs2cs that I want the second one? If said differently, instead of giving

> input and ouput crs to cs2cs, can I provide only the transformation name or

> provide the transformation name in addition to the input and output CRS?

> Here "Inverse of NTF to WGS 84 (1) + NTF_Lambert_Zone_II" for example, the

> second field I got using --summary option (= WKT2 CONCATENATEDOPERATION

> name).

 

You have to use cct with the PROJ pipeline emitted by projinfo to control precisely which

transformation you want to use

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com

 

-----------------------------------------

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
PROJ mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/proj