Skip to content

Conversation

@Withalion
Copy link
Contributor

@Withalion Withalion commented Nov 24, 2025

This PR includes multiple improvements to GNSS data handling, elevation handling and some more improvements.

  1. Geoid separation support for external providers #4176 Adds geoid separation value to GPS information panel. The value is gathered from external GNSS devices. This value can be used to recalculate ellipsoid elevation to geoid elevation or vice versa. Also adds geoid_separation variable.
  2. Recalculate ellipsoid elevation to orthometric #4210 Adds transformation of ellipsoidal elevation to geoid elevation with the default usage of EGM96 geoid model. This transformation is applied for internal provider (both iOS and android), fused provider on android, position tracking.
photo showing GPS panel in Mergin Maps, with dialog open, which specifies that EGM96 model is used to calculate elevation
  1. Refactor code to use existing QgsCoordinateTransformContext #4228 Sometimes we didn't use QgsCoordinateTransformContext from the project, which would fail transformations if users used custom transformation.
  2. Geoid separation support for internal providers #4216 Introduced slight change for external providers. We don't trust the models used in GNSSes, the received data is tranformed to ellipsoid elevation and then again to geoid elevation using our model. Geoid separation is calculated by us. Besides this, the internal, android and simulated providers also return geoid separation data.
  3. Mock location detection - when using android position provider (fused in application) we detect if the position is mocked and we show this to users.
GPS panel in Mergin Maps showing 'Mocked position provider' info
  1. Custom geoid support #4238 In some cases using a more precise local geoid model is necessary for users. This PR added this support if a specific geoid model is specified for the project. The geoid model has to be specified in qgis plugin and it's grid shift file has to be packaged with the project to work correctly. Users will see that the project is using custom geoid model in GPS info panel.
Position inside of geoid area Position outside of geoid area
photo showing elevation and elevation separation info when using local geoid model photo showing uknown elevation and elevation separation info when using local geoid model

To summarise:

  • new form variable geoid_separation => should be used as @position_geoid_separation
  • bluetooth (external GNSS) provider
    • we show geoid (orthometric) elevation now using EGM96 geoid model (bundled with app) by default and using custom model if setup
    • the provided data gets transformed to ellipsoid elevation and then using our model to geoid elevation again
    • we also show geoid separation (undulation)
  • internal provider
    • iOS
      • we show geoid (orthometric) elevation now using EGM96 geoid model (bundled with app) by default and using custom model if setup
      • we also show geoid separation (undulation)
    • Android
      • we show geoid (orthometric) elevation now using EGM96 geoid model (bundled with app) by default and using custom model if setup
      • we also show geoid separation (undulation)
  • fused provider
    • we show geoid (orthometric) elevation now using EGM96 geoid model (bundled with app) by default and using custom model if setup
    • we also show geoid separation (undulation)
    • we detect mock position and show it to user
  • simulated provider
    • we show geoid (orthometric) elevation now using EGM96 geoid model (bundled with app) by default and using custom model if setup
    • we also show geoid separation (undulation)

@wonder-sk soft ping if you want to have another look

tomasMizera and others added 5 commits November 19, 2025 12:09
* 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
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
@Withalion Withalion self-assigned this Nov 24, 2025
@Withalion
Copy link
Contributor Author

Withalion commented Nov 24, 2025

@IvaKuklica for testing #4165 #2615 #2725 #4221 feel free to use builds here:
### 2025.8.0
- iOS: 25.11.827911

@Withalion
Copy link
Contributor Author

Withalion commented Dec 2, 2025

@IvaKuklica for testing #4165 #2615 #2725 #4221 #4237 feel free to use builds here:

2025.8.0

P.S: these include stuff until custom geoid support

@Withalion
Copy link
Contributor Author

We should also subtract the height of antenna from the elevation in GPS panel

@IvaKuklica
Copy link

Testing of bluetooth (external GNSS) provider
Status: - in progress

Application (+ app version, build, operating system):
🍎 iOS: ios 26.1 / build 25.12.831411 - 25.11.827911
CRS: WGS84_EGM96
Project: test_orthometric_heights

Summary:
During the testing of RX connection, the conversion of ellipsoid altitude to orthometric using EGM96 geoid model is incorrect.
The Geoid altitude in MM application shows only negative value of Geoid separation (undulation).
Also vertical accuracy displays a constant value of 9.5m.

See screenshot below:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

6 participants