2

I have installed GDAL-3.9.2-cp313-cp313-win_amd64.whl using Anaconda and I want to perform coordinate transformations with simple command lines using gdaltransform.

The issue I have is that the grid files needed for the transformation doesn't seem to be used.

Ex : I am trying to convert from WGS84 EPSG:4326 to WGS84 + EGM96 height EPSG:4326+5773

The command line I am using looks like this :

gdaltransform -s_srs EPSG:4326 -t_srs EPSG:4326+5773

If i look in the proj.db database I can located the expected grid file name WW15MGH.GRD. I have downloaded this file and installed it in multiple locations, but it never seems to be taken into account.

I have tried installing it in the same folder than the proj.db. I have tried setting up the environment variable PROJ_DATA and PROJ_LIB and put the grid file in this defined path. But it didn't make it work.

I am out of ideas now.

How can I spot what I am doing wrong?

New contributor
Sylvain is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

1 Answer 1

4

EPSG:4326 is a 2D system and therefore height is not processed.

projinfo -s epsg:4326 -t epsg:4326+5773
Candidate operations found: 1
-------------------------------------
Operation No. 1:

unknown id, Inverse of Null geographic offset from WGS 84 to WGS 84, 0 m, World.

PROJ string:
+proj=noop

Try EPSG:4979 https://spatialreference.org/ref/epsg/4979/ instead

projinfo -s EPSG:4979 -t EPSG:4326+5773
Candidate operations found: 2
-------------------------------------
Operation No. 1:

unknown id, WGS 84 to EGM96 height (1), 1 m, World.

PROJ string:
+proj=pipeline
  +step +proj=axisswap +order=2,1
  +step +proj=unitconvert +xy_in=deg +xy_out=rad
  +step +inv +proj=vgridshift +grids=us_nga_egm96_15.tif +multiplier=1
  +step +proj=unitconvert +xy_in=rad +xy_out=deg
  +step +proj=axisswap +order=2,1

Test with gdaltransform:

gdaltransform -s_srs EPSG:4979 -t_srs EPSG:4326+5773
Enter X Y [Z [T]] values separated by space, and press Return.
50 70 100
50 70 96.9851653575897
3
  • Thanks for you answer. however I am doubting this is the issue here. I used this in the past and it was working. I just can't get the environement correct this time. Also, doing this conversion gives me a result, in 3D, without errors: gdaltransform -s_srs EPSG:32630 -t_srs EPSG:4326 --debug ON Enter X Y [Z [T]] values separated by space, and press Return. 894000 4995124 100 1.99902956148316 45.0000377974071 100
    – Sylvain
    Commented 10 hours ago
  • And I tried your suggestion but without success.
    – Sylvain
    Commented 10 hours ago
  • 1
    I added a gdaltransform example and used EPSG:4979 that seems to be the current code in the EPSG database. Works for me with GDAL 3.11.0dev and Proj 9.5.0. Conversion from EPSG:32630 into EPSG:4326 is 2D, the z coordinate is just copied as-is.
    – user30184
    Commented 10 hours ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.