[gdal-dev] Datum transformation CSV->CSV for WGS84->DGN95

Even Rouault even.rouault at spatialys.com
Wed Jun 5 14:02:03 PDT 2019


On mercredi 5 juin 2019 11:07:44 CEST Sebastian Schoeller wrote:
> Dear all,
> 
> I posted a problem on
> 
> https://gis.stackexchange.com/questions/324848/transform-datum-csv-csv-using
> -ogr2ogr?noredirect=1#comment529063_324848
> 
> and was refered to list mailing list. I am trying to convert Z in
> UTM48S/WGS84 to either DGN95 or EGM2008 datum. From what I may read on
> epsg.io the EPSG code definition is
> 
> EGM2008 datum: 3855
> WGS84 datum: 4979
> DNG95 datum: 6755
> ID74 datum: 6238

For GDAL < 3.0 and EGM2008, this is mostly an issue of having the egm08_25.gtx 
grid installed alongside of others PROJ resources, and then

$ echo "9231824.04 787648.04 711.1442" | \
     gdaltransform -s_srs EPSG:32748  -t_srs EPSG:32748+3855
9231824.03999554 787648.040034059 689.737249081086

For GDAL >= 3.0, this is a bit more tricky, since the system is a bit more 
pedantic about geodetic correctness and will not want to transform between a 
2D CRS and a 3D CRS, so you have to do a 2-step dance:

$ echo "9231824.04 787648.04 711.1442" | \
   gdaltransform -s_srs EPSG:32748 -t_srs EPSG:4326 | \
   gdaltransform -s_srs EPSG:4979  -t_srs EPSG:32748+3855
9231824.03999555 787648.040034041 689.737249081087

I'm a bit confused by your mentions of DGN95 and ID74. Those are geodetic 
(horizontal) datum / geodetic CRS, so they cannot be compared to a vertical 
CRS like EGM2008.

You can transform between both (using the CRS codes corresponding to the 
datum):

For GDAL < 3.0, you'll get for example

$ echo "100 0" | gdaltransform -s_srs EPSG:4238 -t_srs EPSG:4755
100.000235718449 4.52183853812619e-05 12.3954959195107
(but you should ignore the Z value of 12.xxxx, which is irrelevant.)

For GDAL >=3.0,
$ echo "100 0" | gdaltransform -s_srs EPSG:4238 -t_srs EPSG:4755
100.000229251525 2.22071403023558e-05 0

The transformation parameters between ID74 and WGS84/DGN95 have changed 
between both GDAL/PROJ versions, hence the difference in results

Regarding DGN95 to WGS84 conversion, this is considered by EPSG (operation 
15912) as a transformation with no coordinate change with an accuracy of 1m.

$ echo "100 0" | gdaltransform -s_srs EPSG:4755 -t_srs EPSG:4326
100 0 0


Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list