Recalculate ellipsoid elevation to orthometric#4210
Recalculate ellipsoid elevation to orthometric#4210Withalion merged 10 commits intodev/geoid-supportfrom
Conversation
Pull Request Test Coverage Report for Build 19369508469Details
💛 - Coveralls |
Add EGM96_15 geoid model, which recalculates ellipsoid altitudes returned by position providers. Expose this information in GPS information panel.
8f9da6f to
131f97b
Compare
Provider returns now WGS84 ellipsoidal height on iOS
Create new 3D transform utils function. Fix coordinate order passing. Rework android 15+ Qt positioning workaround to VCPKG patch.
|
PR should be finally ready now for review |
|
@tomasMizera I think you could give it a look as well. |
| mapSettings->destinationCrs(), | ||
| crsGPS, | ||
| PositionKit::positionCRS(), | ||
| QgsCoordinateTransformContext(), |
There was a problem hiding this comment.
not directly relevant to this PR, but we should not use empty QgsCoordinateTransformContext() - we should use coordinate transform context from the active project everywhere, to avoid some subtle transformation errors (e.g. when project admin picks a non-default transform). Worth checking elsewhere too!
There was a problem hiding this comment.
I guess this is worth to do as a separate PR and go through the whole code base. I'll create a new issue for this and try to tackle it.
| QGeoPositionInfo location(QGeoCoordinate(newLocation.coordinate.latitude, | ||
| newLocation.coordinate.longitude, | ||
| - newLocation.altitude), | ||
| + newLocation.ellipsoidalAltitude), |
There was a problem hiding this comment.
is this safe? I have read ellipsoidalAltitude is only available in iOS 15+ ... do we support older versions? if we do, what happens there?
Also, what happens with external GNSS with mock location - is the ellipsoidal altitude populated correctly?
There was a problem hiding this comment.
- We support only iOS 16+, so there's no need to check for lower version.
- I'll have to check the external GNSS behaviour, haven't thought much about that.
There was a problem hiding this comment.
@wonder-sk there is not an easy way to debug that without access to the device, I'll ask our testing team to try it. However, I would postpone this issue for a bit and the whole bundle of enhancements will include also fix for this.
* Geoid separation support for external providers (#4176) * Recalculate ellipsoid elevation to orthometric (#4210) * Enhance position altitude processing Add EGM96_15 geoid model, which recalculates ellipsoid altitudes returned by position providers. Expose this information in GPS information panel. * Fix broken builds * Fix formatting * Add geoid info for iOS * Refactor PositionKit to singleton from context property * Patch ios internal positioning provider Provider returns now WGS84 ellipsoidal height on iOS * Fix elevation transform & android workaround Create new 3D transform utils function. Fix coordinate order passing. Rework android 15+ Qt positioning workaround to VCPKG patch. * Clean up & format code * Add patch TODO * Fix some review issues * Refactor code to use existing QgsCoordinateTransformContext (#4228) * Geoid separation support for internal providers (#4216) * Squashed commit of the following: commit 27b19a4 Author: Matej Bagar <matej.bagar@lutraconsulting.co.uk> Date: Mon Nov 24 15:22:46 2025 +0200 Add mock location detection for android position provider * Change default value for elevation_diff * Custom geoid support (#4238) * Fixed plural translation forms (#4183) * Fixed android build to sync projects (#4243) * Refactor support for orthometric heights on iOS * Subtract antenna height from altitude * Fix formatting & vcpkg bug * Fix ios patch * Fix ios patch v2 * Fix iOS error & constness * Fix iOS error v3 * Add ellipsoidal elevation expr variable * Change elevation calculation * Increase click area for elevation info button * Use default transform for internal providers * Use default geoid model for android fused provider * Add vertical CRS transform pass through for mock providers * Add vertical CRS transfrom pass through for bluetooth provider * Change android fused provider to default on android * Fix GPS panel geoid model name info * Change behaviour for internal provider on desktops * Use EGM96 geoid model for simulated provider * Fix iOS build * Small refactor * Set internal providers to use mixture of vertical CRS * Fix review issues * Refactor providers to use PositionTransformer * Add PositionTransform reload on project load * Add unit tests for PositionTransformer * Rename project setting name * Remove commented code, minor typo fixes, simulated provider cleanup * Fix tests & formatting * Fix tests * Add test debug logs for CI * Fix wrong test initialization for bluetoothless devices * Revert "Fix wrong test initialization for bluetoothless devices" This reverts commit 1541538. * Refactor PositionTransformer creation & clear QgsProject refs in PositionKit * Remove InputCoordinateTransformer * Fix review issues * Fix function typo --------- Co-authored-by: Tomas Mizera <tomas.mizera@lutraconsulting.co.uk> Co-authored-by: Kaustuv Pokharel <85729205+kaustuvpokharel@users.noreply.github.com> Co-authored-by: Gabriel Bolbotina <80618569+gabriel-bolbotina@users.noreply.github.com>
fixes #4165
fixes #2615
This PR adds EGM96_15 geoid model internally to recalculate ellipsoid heights returned by position providers to orthometric heights by default. Also, the information of which model was used is exposed to users in GPS information panel. There are some necessary fixes to Qt Positioning to force

InternalPositioningProviderto return ellipsoid height on both android and iOS.Besides this, some minor refactoring was done to prepare the rest of the codebase to support user supplied geoid models.