[PROJ] Question about transformation using cs2cs

Even Rouault even.rouault at spatialys.com
Wed Sep 29 07:42:49 PDT 2021


Hi,

you're actually hitting this very old change in behavior in PROJ that 
still applies with recent versions: 
https://proj.org/usage/differences.html#version-4-6-0

Just specifying a +ellps= doesn't define a datum. There's no way we can 
relate the 2 datums that are partially defined by just their ellipsoids. 
So when considering the geographic coordinates, they are just kept 
unchanged; Which explains the behaviour of the second cs2cs invokation.

Why do you get different results in the UTM projected coordinates ? 
Because projection computation takes into account the ellipsoid shape. 
But you won't get a datum shift by itself when doing so.

So you'll probably have to specify a +towgs84 or +nadgrids parameters to 
your source CRS to define how it relates with the WGS 84 datum, and 
replace on the target CRS +ellps=WGS84 by +datum=WGS84

The PROJ debug traces are quite verbose and hard to understand if you're 
not a developer, so they won't help much.

If you know the EPSG codes of the CRS, you'd better using them directly 
to get more significant transformations.

Even

Le 29/09/2021 à 16:18, José Luis García Pallero a écrit :
> Hello:
>
> I'm using PROJ 7.2.1 from Debian repositories and I have some
> questions about cs2cs. If I run
>
> echo 1445748.66 5053500.03 | cs2cs +proj=utm +zone=10 +ellps=intl +to
> +proj=utm +zone=10 +ellps=WGS84
>
> I obtain
>
> 1445704.69      5053404.02 0.00
>
> so the transformation of UTM coordinates between a point on the
> international ellipsoid to WGS84 was performed.
>
> But if I try to do the same with geographical coordinates as
>
> echo 111W 45N | cs2cs +proj=latlong +ellps=intl +to +proj=latlong +ellps=WGS84
>
> I obtain
>
> 111dW   45dN 0.000
>
> so no transformation was performed. Why? Setting PROJ_DEBUG I obtain
> for this case
>
> pj_open_lib(proj.db): call fopen(/usr/share/proj/proj.db) - succeeded
> pj_open_lib(proj.ini): call fopen(/usr/share/proj/proj.ini) - succeeded
> pj_ellipsoid - final: a=6378137.000 f=1/298.257, errno=0
> pj_ellipsoid - final:    ellps=GRS80
>
> Here I understand that only the second declaration of +ellps was taken
> into account (althoug EGS84 and GRS80 ellipsoids are not exactly the
> same)
>
> Thanks

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



More information about the PROJ mailing list