-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider non-planar calculations in profile tool #48270
Comments
@saberraz project CRS ? |
3857! |
This is not a trivial fix, if indeed it is a bug. The profile tool is based entirely on planar calculations in the project's selected CRS, not ellipsoidal/great circle distances. I honestly doubt it's feasible at this stage to create a ellipsoidal aware profile tool -- the underlying libraries like libgeographic which we use for handling ellipsoidal calculations just don't have any capacity for handling elevations (I suspect because the mathematics required for these are horrendously complex!). Non-planar profiles would open a whole bunch of related questions too... eg if I draw a long enough profile line, would I expect to see the Earth's curvature shown in the profile chart? And if so, then you'd also expect to see vertical features drawn perpendicular to the surface from their base point. Or would the profile line always be considered as occurring along the surface of the ellipsoid? Leaving everything as planar and requiring users to make a suitable local projection choice is an acceptable limitation in my view. We could consider adding a check and user facing warning here though, e.g. by measuring the profile line's ellipsoidal length and comparing against it's cartesian length, and if the difference exceeds say 2% then show a warning advising the user that their choice of CRS is misleading and to review this choice. |
I am easy with a warning. Another safer option would be to block users from creating the profile altogether if the difference is more than 2% and show a warning message. |
With the introduction of the We use distance/height calculations from the Swiss National Mapping Agency (Swisstopo) via web API. @nyalldawson, could we override the profile canvas' max width with the max distance we get from the API (or with the max distance from all profiles sources available) to get rid of this issue? |
I'm -1 to that -- we'll just be providing obfuscated incorrect values if we go that route. This would still be my preferred approach:
|
Fair enough. We've switched to planar (2d) cartesian distances instead to stick to QGIS elevation profile functionality. |
What is the bug or the crash?
The distance (x axis) appears to be incorrect:
The identify tool displays the distance to be slightly less than 80km. But the same line appears to be over 100km in the profile tool along x axis. Ping me for the data and I can share it with you.

Steps to reproduce the issue
1- Load a GPX dataset
2- Create a profile
3- Compare the length from identify tool vs. x axis.
Versions
QGIS master
Supported QGIS version
New profile
Additional context
No response
The text was updated successfully, but these errors were encountered: