Skip to content

Conversation

@Withalion
Copy link
Contributor

@Withalion Withalion commented Nov 11, 2025

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 InternalPositioningProvider to return ellipsoid height on both android and iOS.
image
Besides this, some minor refactoring was done to prepare the rest of the codebase to support user supplied geoid models.

@github-actions
Copy link

github-actions bot commented Nov 11, 2025

Pull Request Test Coverage Report for Build 19369508469

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2793 unchanged lines in 17 files lost coverage.
  • Overall coverage decreased (-0.2%) to 19.31%

Files with Coverage Reduction New Missed Lines %
build-mm-db/vcpkg_installed/x64-linux/include/Qt6/QtCore/qhash.h 1 81.05%
mm/app/attributes/attributecontroller.cpp 1 76.83%
mm/app/position/providers/simulatedpositionprovider.cpp 1 90.91%
build-mm-db/core/mm_core_autogen/EWIEGA46WW/moc_merginapi.cpp 3 44.31%
mm/core/merginuserauth.cpp 9 68.24%
build-mm-db/app/.rcc/qmlcache/MerginMaps_qml/map/MMStakeoutTools_qml.cpp 13 0.0%
mm/core/merginapi.cpp 14 74.98%
mm/app/map/inputcoordinatetransformer.cpp 24 0.0%
mm/app/main.cpp 39 35.88%
mm/app/position/providers/internalpositionprovider.cpp 42 22.12%
Totals Coverage Status
Change from base Build 19262013598: -0.2%
Covered Lines: 13813
Relevant Lines: 71532

💛 - Coveralls

Add EGM96_15 geoid model, which recalculates ellipsoid altitudes
returned by position providers. Expose this information in GPS
information panel.
@Withalion Withalion force-pushed the feature/altitudes-converter branch from 8f9da6f to 131f97b Compare November 11, 2025 19:22
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.
@Withalion
Copy link
Contributor Author

Withalion commented Nov 14, 2025

PR should be finally ready now for review

@Withalion Withalion changed the base branch from master to dev/geoid-support November 15, 2025 07:59
@gabriel-bolbotina
Copy link
Contributor

@tomasMizera I think you could give it a look as well.

mapSettings->destinationCrs(),
crsGPS,
PositionKit::positionCRS(),
QgsCoordinateTransformContext(),
Copy link
Contributor

Choose a reason for hiding this comment

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

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!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see #4221

QGeoPositionInfo location(QGeoCoordinate(newLocation.coordinate.latitude,
newLocation.coordinate.longitude,
- newLocation.altitude),
+ newLocation.ellipsoidalAltitude),
Copy link
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@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.

@Withalion Withalion requested a review from wonder-sk November 19, 2025 12:22
@Withalion Withalion merged commit 4436062 into dev/geoid-support Nov 19, 2025
11 of 12 checks passed
@Withalion Withalion deleted the feature/altitudes-converter branch November 19, 2025 12:55
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.

Android 15+ returns geoid altitude while older Androids show ellipsoid altitude Convert ellipsoid heights to orthometric (apply geoid undulation)

4 participants