mobile
mobile copied to clipboard
Convert ellipsoid heights to orthometric (apply geoid undulation)
In some cases it may be useful for users to get automatic conversion between ellipsoid heights and orthometric heights - or in other terms, to (un-)apply geoid undulation. (Note: external GNSS return orthometric heights, and they also return geoid separation used for the height measurement to allow switching to ellipsoid height, but this information is currently not kept in Input - see #2725)
For this we would need to have access to the EGM2008 geoid model (~77MB) - https://github.com/OSGeo/PROJ-data/blob/master/us_nga/us_nga_egm08_25.tif - we could download it from CDN first time such option would be enabled.
To list transforms to from ellipsoidal heights to orthometric heights (EPSG:4979 would be actually more correct CRS as it is 3D, EPSG:4326 is 2D):
projinfo -s EPSG:4326 -t EPSG:4326+3855
This returns WGS 84 to EGM2008 height (1) with this definition:
+proj=pipeline
+step +proj=axisswap +order=2,1
+step +proj=unitconvert +xy_in=deg +xy_out=rad
+step +inv +proj=vgridshift +grids=us_nga_egm08_25.tif +multiplier=1
+step +proj=unitconvert +xy_in=rad +xy_out=deg
+step +proj=axisswap +order=2,1
Then converting lat=50 deg north, lon=20 deg east, alt=100 m above ellipsoid gives ~60 m orthometric height which seems correct:
$ export PROJ_NETWORK=ON # to allow PROJ fetch the geoid raster data from network
$ echo 50 20 100 0 | cct "WGS 84 to EGM2008 height (1)"
50.0000000000 20.0000000000 60.2805 0.0000
Workaround for now with ogr2ogr (with points_ellipsoid.gpkg being input file):
$ PROJ_NETWORK=ON ogr2ogr -s_srs EPSG:4326 -t_srs EPSG:4326+3855 points_ortho.gpkg points_ellipsoid.gpkg
Android API provides ellipsoid altitudes. API for orthometric heights is not available: https://issuetracker.google.com/issues/195660815?pli=1
If I understand correctly, on Android one could also get NMEA stream - this stream should also include orthometric height and used geoid separation. It seems that the geoid separation may have quite low resolution, so the orthometric heights may not be very accurate anyway.
From Android 14, there is a converter to orthometric heights: https://developer.android.com/reference/android/location/altitude/AltitudeConverter
This issue has been linked to a Hellonext post: Add support for orthometric height :sparkles:
Letting the user choose which geoid model to use would open for a lot of use cases involving surveying with high accuracy. We have multiple cases where we need to correct high accuracy measurements to Danish DVR90 height (for instance https://epsg.io/4097). It seems like a relatively common use case: https://docs.qfield.org/how-to/gnss/#altitude-correction-vertical-grid-shift