[PROJ] [Questions] Vertical transformations advices for PROJ >= 9.1 version

Christian DOULIAC christian.douliac at magellium.fr
Wed Oct 2 05:55:02 PDT 2024


Hello thanks for your quick answer,

Indeed adding --3d to cs2cs command give me the past behavior.
The commands that I wrote were only here for the example, to illustrate that I can recreate the behaviors.
My goal is to be more generic, I would like to be able to do CRS conversions without knownledges of them at first, using the PROJ C API.

I found some advices here https://github.com/OSGeo/PROJ/pull/3119#issuecomment-1069272183
and here https://github.com/OSGeo/PROJ/pull/3119#issuecomment-1069272183 .
What I understood from theses comments is that promoting CRS to 3D only make sense for PJ_TYPE_GEOGRAPHIC_2D_CRS and PJ_TYPE_PROJECTED_CRS types.
I would like to detect theses cases and promoting the CRS accordingly with the API.

My questions are multiple :
-first did I understood right?
-Are there others cases (or types) that I should think about?
-Is looking for the CRS type is enough or should I look for other information?

________________________________
De : Even Rouault <even.rouault at spatialys.com>
Envoyé : mardi 1 octobre 2024 15:13:11
À : Christian DOULIAC; proj at lists.osgeo.org
Objet : Re: [PROJ] [Questions] Vertical transformations advices for PROJ >= 9.1 version



Le 01/10/2024 à 11:04, Christian DOULIAC via PROJ a écrit :

Hello, I would like some precision about CRS conversions.

I'm aware that there are some changes about vertical transformations with PROJ >= 9.1 as stated here : <https://github.com/OSGeo/PROJ/pull/3119> https://github.com/OSGeo/PROJ/pull/3119
Or here : https://proj.org/en/9.4/apps/cs2cs.html#cmdoption-cs2cs-3d "Starting with PROJ 9.1, both CRS need to be 3D for vertical transformation to possibly happen."

I tested it and I recreated the behavior of pre 9.1 and post 9.1 versions :

-PROJ 8.2.0 :
echo 0 0 1000 | cs2cs +proj=longlat +datum=WGS84 +geoidgrids=/proj-build/data/for_tests/egm96_15.tif +vunits=m +no_defs +type=crs +to +proj=longlat +datum=WGS84 +no_defs +type=crs -f "%.14f"
0.00000000000000 0.00000000000000 1017.16157913208008

-PROJ 9.2.0
echo 0 0 1000 | cs2cs +proj=longlat +datum=WGS84 +geoidgrids=/proj-build/data/for_tests/egm96_15.tif +vunits=m +no_defs +type=crs +to +proj=longlat +datum=WGS84 +no_defs +type=crs -f "%.14f"
0.00000000000000 0.00000000000000 1000.00000000000000

Add --3d to promote the target CRS to 3D.


Or use: cs2cs -f "%.14f" EPSG:4326+5773 EPSG:4979  (with lat, long order)

--
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20241002/332f1a04/attachment.htm>


More information about the PROJ mailing list