Skip to content

Geoid separation support for internal providers#4216

Merged
Withalion merged 16 commits intodev/geoid-supportfrom
feature/geoid-undulation-internal
Nov 21, 2025
Merged

Geoid separation support for internal providers#4216
Withalion merged 16 commits intodev/geoid-supportfrom
feature/geoid-undulation-internal

Conversation

@Withalion
Copy link
Contributor

@Withalion Withalion commented Nov 15, 2025

fixes #2725

This PR is a continuation from #4176 and also includes the changes introduced by #4210. In short we add the geoid separation calculation for internal, android and simulated providers.

For external providers we also recalculate orthometric elevation to use our model.

@Withalion Withalion linked an issue Nov 15, 2025 that may be closed by this pull request
@Withalion Withalion force-pushed the feature/geoid-undulation-internal branch from fe06747 to 66f9cf6 Compare November 19, 2025 20:49
@Withalion Withalion requested review from wonder-sk and removed request for tomasMizera November 19, 2025 20:55
QgsCoordinateReferenceSystem PositionKit::positionCrs2D()
{
return QgsCoordinateReferenceSystem::fromEpsgId( 4326 );
return QgsCoordinateReferenceSystem::fromEpsgId( 9707 );
Copy link
Contributor

Choose a reason for hiding this comment

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

🤯 ... looks like there are a couple of things to fix after rebase 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops, yeah

@github-actions
Copy link

github-actions bot commented Nov 20, 2025

Pull Request Test Coverage Report for Build 19539640728

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 52 unchanged lines in 9 files lost coverage.
  • Overall coverage increased (+0.02%) to 19.368%

Files with Coverage Reduction New Missed Lines %
build-mm-db/vcpkg_installed/x64-linux/include/Qt6/QtCore/qhash.h 1 81.05%
build-mm-db/vcpkg_installed/x64-linux/include/Qt6/QtCore/qjsonobject.h 1 90.91%
build-mm-db/vcpkg_installed/x64-linux/include/Qt6/QtCore/qjsonvalue.h 1 95.24%
mm/app/layerfeaturesmodel.cpp 2 78.88%
build-mm-db/vcpkg_installed/x64-linux/include/Qt6/QtCore/qstring.h 3 88.02%
mm/app/position/providers/simulatedpositionprovider.cpp 7 91.11%
mm/core/merginapi.cpp 10 75.26%
mm/app/position/providers/bluetoothpositionprovider.cpp 11 78.85%
mm/app/position/providers/internalpositionprovider.cpp 16 21.19%
Totals Coverage Status
Change from base Build 19539573825: 0.02%
Covered Lines: 13858
Relevant Lines: 71551

💛 - Coveralls

@Withalion
Copy link
Contributor Author

@wonder-sk it should be cleaned up now 👍🏻

double altitude = ( *mGenerator )() % 40 + 20; // rand altitude <20,55>m and lost (0)
if ( altitude <= 55 )
double altitude = ( *mGenerator )() % 40 + 80; // rand altitude <80,120>m and lost (0)
if ( altitude <= 120 )
Copy link
Contributor

Choose a reason for hiding this comment

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

is there any point of this "if"? it seems that now it will be always true if I calculate it correctly. Not sure if the code previously made much sense (altitude=0 meaning no altitude?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like I misunderstood the code a bit too. Hopefully now it makes more sense

@Withalion Withalion force-pushed the feature/geoid-undulation-internal branch from 89b87bc to 0984bbf Compare November 20, 2025 14:08
@Withalion Withalion merged commit 2d801ea into dev/geoid-support Nov 21, 2025
12 checks passed
@Withalion Withalion deleted the feature/geoid-undulation-internal branch November 21, 2025 08: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

2 participants