Skip to content

Geoid separation support for external providers#4176

Merged
Withalion merged 2 commits intodev/geoid-supportfrom
feature/geoid-separation-support
Nov 19, 2025
Merged

Geoid separation support for external providers#4176
Withalion merged 2 commits intodev/geoid-supportfrom
feature/geoid-separation-support

Conversation

@tomasMizera
Copy link
Collaborator

@tomasMizera tomasMizera commented Oct 22, 2025

Just a quick demo for geoid separation

Resolves #2725

@tomasMizera tomasMizera requested a review from wonder-sk October 22, 2025 14:14
@github-actions
Copy link

github-actions bot commented Oct 22, 2025

Pull Request Test Coverage Report for Build 18729738405

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 165 unchanged lines in 6 files lost coverage.
  • Overall coverage increased (+0.03%) to 19.499%

Files with Coverage Reduction New Missed Lines %
build-mm-db/vcpkg_installed/x64-linux/include/Qt6/QtCore/qhash.h 1 81.25%
build-mm-db/vcpkg_installed/x64-linux/include/Qt6/QtCore/qstring.h 3 88.02%
mm/core/merginapi.cpp 7 75.22%
mm/app/position/positionkit.cpp 27 77.46%
mm/app/variablesmanager.cpp 37 26.12%
build-mm-db/app/MerginMaps_autogen/OEYYAC7AGO/moc_positionkit.cpp 90 42.12%
Totals Coverage Status
Change from base Build 18678537201: 0.03%
Covered Lines: 13840
Relevant Lines: 70978

💛 - Coveralls

Copy link
Contributor

@wonder-sk wonder-sk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - and testing with external GNSS confirms it works.

One thing worth fixing: with internal GNSS, the GPS info panel shows geoid separation being "0.00 m" which could be confusing - it would be better to report it as N/A. Or maybe we could add calculation of geoid separation for internal GNSS while at this:

ct=QgsCoordinateTransform(
    QgsCoordinateReferenceSystem("EPSG:4979"),  # WGS84 + ellipsoid height
    QgsCoordinateReferenceSystem("EPSG:9707"),  # WGS84 + EGM96 geoid height
    QgsCoordinateTransformContext())  # TODO: use project's context
# this is ellipsoid height of 200 m converted to geoid height - at lat 49°, lon 18°
print(ct.transform(QgsVector3D(18,49,200)).z())

(we just need to verify we have egm96 geoid shipped with PROJ - on my system it is in file egm96_15.gtx - cca 4 MB)

@tomasMizera tomasMizera changed the base branch from dev/2025.7.0 to master October 31, 2025 12:51
@Withalion Withalion changed the base branch from master to dev/geoid-support November 15, 2025 08:00
@Withalion Withalion changed the title WIP: Geoid separation support Geoid separation support Nov 15, 2025
@Withalion
Copy link
Contributor

Let's keep this PR as it is and I'll create a new one to resolve the issue with internal providers. It seems better to me as we will be building on top of the work done here and also in #4210.

@Withalion Withalion changed the title Geoid separation support Geoid separation support for external providers Nov 18, 2025
@Withalion Withalion merged commit d3e961e into dev/geoid-support Nov 19, 2025
9 checks passed
@Withalion Withalion deleted the feature/geoid-separation-support branch November 19, 2025 12:09
Withalion added a commit that referenced this pull request Feb 9, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get geoid separation (undulation) from external GNSS

3 participants