[gdal-dev] gdalwarp and gdaltransform are inconsistent

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Mon Apr 20 01:08:15 PDT 2020


Hi,

When it comes to gdalwarp I believe that this part of the documentation
https://gdal.org/programs/gdalwarp.html is essential

"Starting with GDAL 2.2, if the SRS has an explicit vertical datum that
points to a PROJ.4 geoidgrids, and the input dataset is a single band
dataset, a vertical correction will be applied to the values of the
dataset."

Both EPSG:4326 and EPSG:2056 are 2D systems without explicit vertical datum.
EPSG:4979 is explicit 3D  
http://www.epsg-registry.org/export.htm?wkt=urn:ogc:def:crs:EPSG::4979 and
the compound crs syntax that you used (-s_srs EPSG:2056+5728) is explicit as
well.

I do not know how gdaltransform knows to do the conversion in Z coordinate
and how to give the -s_srs and -t_srs right for gdalwarp but I would try
next with
-s_srs EPSG:2056+5728 -t_srs epsg:4979

-Jukka Rahkonen-



Pillio Zoltan wrote
> Hi,
> 
> I'm new here, and just started using gdal, so maybe I'm misunderstanding
> something, but I found that gdalwarp and gdaltransform produces different
> results.
> 
> The gdaltransform command is :
> echo 2600000 1196000 768 | gdaltransform -t_srs EPSG:4326 -s_srs EPSG:2056
> 
> and the result is:
> 7.43863317174838 46.9151021335816 817.714334204793
> 
> ,but if I'm converting a geotif with the following command:
> gdalwarp -t_srs EPSG:4326 -s_srs EPSG:2056
> SWISSALTI3D_10_TIFF_CHLV95_LN02_2600_1196.tif test.tif
> 
> the height doesn't change. I'm using swisstopo example data from here:
> https://cms.geo.admin.ch/Topo/swissalti3d/swissalti3dgeotifflv95.zip
> 
> I did the conversion by myself based on swisstopo documentation (link
> above), and the result of gdaltransform is correct, but gdalwarp is wrong.
> 
> Do I misunderstand something, or did I make a mistake?
> 
> I'm using GDAL 2.4.2, released 2019/06/28
> 
> Thank you in advance for your help.
> 
> Best regards,
> Zoltan Pillio
> 
> ps.:
> I also found that setting height reference frame has no effect in these
> cases:
> echo 2600000 1196000 768 | gdaltransform -t_srs EPSG:4326 -s_srs EPSG:2056
> echo 2600000 1196000 768 | gdaltransform -t_srs EPSG:4326 -s_srs
> EPSG:2056+5728
> echo 2600000 1196000 768 | gdaltransform -t_srs EPSG:4326 -s_srs
> EPSG:2056+5729
> 
> and the swisstopo documentation for conversion I used:
> https://www.swisstopo.admin.ch/content/swisstopo-internet/en/online/calculation-services/_jcr_content/contentPar/tabs/items/documents_publicatio/tabPar/downloadlist/downloadItems/19_1467104393233.download/ch1903wgs84_e.pdf
> 
> _______________________________________________
> gdal-dev mailing list

> gdal-dev at .osgeo

> https://lists.osgeo.org/mailman/listinfo/gdal-dev





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list