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
  • new form variable altitude_ellipsoidal => should be used as @position_altitude_ellipsoidal
  • 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)
      • for mocked position we either directly show the geoid elevation from GNSS or if ellipsoid elevation is available we transform it using the selected model
    • 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)

Besides all of these, the altitude value in GPS info panel should show the elevation received from provider minus the antenna height. The same should apply for all elevation variables.

A tip for users setting up external GNSS receivers is to select fused provider on Android and internal provider on iOS, as these providers will show if mocked location is detected.

@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

OLD

@IvaKuklica for testing #4165 #2615 #2725 #4221 #4237 feel free to use builds here:
### 2025.8.0 
- iOS: 25.12.831411
- Android: 
  - [arm-v8](https://play.google.com/apps/test/RQrgmETMGFo/ahAO29uNQ7jEmK5SmppqUp-WI8UZTaL9tKMI1-r2u_FTDcLNn6_qglwAfdle69sXgywriECQeB5EO8MyV_xmkf9LI6) - 737351
  - [arm-v7](https://play.google.com/apps/test/RQrgmETMGFo/ahAO29uNTwRNhiafZ9n6DataCn8t_g0vFjgMKscT_l9ZMAkav6538Y2OblcTDN1BSC4hEBfDgpEEqWgDI1DopTa-G) - 737311
- Windows: [here](https://github.com/MerginMaps/mobile/actions/runs/19851751707/artifacts/4734821292)

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

IvaKuklica commented Dec 3, 2025

Hi @Withalion

Testing of bluetooth (external GNSS) provider

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.

  • ISSUE:

The difference between Mergin Maps application in iOS and Android vs. Emlid Flow is 2m. Probably the height in iOS seems to be displayed incorrectly.

Application (+ app version, build, operating system):
🤖 Samsung Galaxy A53 5G, Android 15 / Build 737351
CRS: WGS84_EGM96
Project: test_orthometric_heights
GPS Antenna Heigh = 0.145 m

  • SUMMARY:

The difference between a feature recorded in Emlid Flow and Mergin Maps applications is on average 0.0075 m.
When comparing individuals points recorded in the both applications, the values ranged from 0.001 to 0.013m.

@Withalion
Copy link
Contributor Author

Hei @IvaKuklica could you fix that image at some point, looks like it's broken/unavailable.

@Withalion
Copy link
Contributor Author

I also increased the click area for the information button, so it's easier to trigger the info popup on smaller screens.

@Withalion Withalion requested a review from tomasMizera December 8, 2025 14:34
@Withalion
Copy link
Contributor Author

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

2025.8.0

  • iOS: 25.12.834011
  • Android:

P.S: these include stuff until increased click area

@tomasMizera
Copy link
Collaborator

After agreement with others, let's do the following for the upcoming release:

  • cherry-pick elevation_diff variable
  • cherry-pick android 15 fix

@Withalion
Copy link
Contributor Author

Some more context:

  • 2025.8.0 release will include just the two enhancements mentioned above
  • some release in early 2026 will include all the enhancements mentioned in this PR
  • few more changes were discussed to incorporate, that's why we moved this to later release

@tomasMizera tomasMizera added the FROZEN 🥶 do not merge before upcoming release label Dec 12, 2025
@Withalion Withalion removed the FROZEN 🥶 do not merge before upcoming release label Dec 18, 2025
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