OSGeo / PROJ

PROJ - Cartographic Projections and Coordinate Transformations Library
https://proj.org
Other
1.69k stars 771 forks source link

cs2cs /cct don't transform height in ETRS89 (EVRF2007) to DHHN2016 #3194

Closed ecr334 closed 2 years ago

ecr334 commented 2 years ago

cs2cs don't transform height in ETRS89 (EVRF2007) to DHHN2016

network = on

cs2cs EPSG:4258 EPSG:7837
51.495833333 14.30625 41.8100
51.50   14.31 41.81
cs2cs EPSG:4258+5621 EPSG:4258+7837
51.495833333 14.30625 41.810
51.50   14.31 41.81

and cct:

cct +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +inv +proj=vgridshift +grids=GCG2016.tif +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1

information on steps taken from projinfo

 projinfo -s EPSG:4258 -t EPSG:7837

Expected Output

Снимок экрана 2022-05-12 в 16 14 12

Environment Information

Installation method

rouault commented 2 years ago

The issue here is that the needed data file GCG2016.txt doesn't seem to be available under free & open data licensing, if I trust https://mis.bkg.bund.de/trefferanzeige?docuuid=983fac52-b7de-4f43-a6f5-91e007a6f963 Unless someone manages to make BKG change their mind about that, there's little we can do

ecr334 commented 2 years ago

I have a test quasigeoid gcg2016 but the conversion does not work with it either https://gdz.bkg.bund.de/index.php/default/quasigeoid-der-bundesrepublik-deutschland-quasigeoid.html

rouault commented 2 years ago

I have a test quasigeoid gcg2016 but the conversion does not work with it either

how did you get the GeoTIFF file ? Did you generate it yourself ? What does "gdallocationinfo -wgs84 GCG2016.tif 14.30625 51.495833333" return (you need GDAL installed)

ecr334 commented 2 years ago

I downloaded the demo at the link: https://sg.geodatenzentrum.de/web_public/gdz/testdaten/quasigeoid.zip and copied the file GCG2016.tif to /usr/local/share/proj

~ % gdallocationinfo -wgs84 GCG2016.tif 14.30625 51.495833333
ERROR 4: GCG2016.tif: No such file or directory

but if you change the path to the .tif file:

 ~ % gdallocationinfo -wgs84 /Users/fedot/Downloads/GCG2016.tif 14.30625 51.495833333 
Report:
  Location: (0P,0L)
  Band 1:
    Value: 41.810001373291
rouault commented 2 years ago

Works for me with cct:

$ echo 51.495833333 14.30625 0 | cct +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +inv +proj=vgridshift +grids=quasigeoid/Gebiet_LAUSITZ/quasigeoid/linux/geotiff/GCG2016_tglausitz.tif +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 51.4958333330 14.3062500000 -41.8100 inf

The fact that it doesn't work with cs2cs out of the box is expected given that PROJ doesn't provide this grid and thus doesn't not alias the name of the grid provided by EPSG : GCG2016.txt You'll have to insert an entry in the grid_alternatives table of proj.db. Cf https://github.com/OSGeo/PROJ/blob/master/data/sql/grid_alternatives.sql

But that won't probably help you much for EVRF2007 to DHHN2016, as there's no known transformation in EPSG from EVRF2007 to ETRS89 ellipsoidal height. EPSG has a "DHHN2016 height to EVRF2007 height" ( https://epsg.org/transformation_7838/DHHN2016-height-to-EVRF2007-height-1.html ) parametric transformation, but this transformation method (Vertical Offset and slope) is not currently implemented in PROJ