Repository navigation
Measurement tool in the 3D map view - #8218
MidnightCoder-m wants to merge 4 commits into
Conversation
🍎 MacOS DMG universal buildsDownload a MacOS DMG universal build of this PR for testing. 📱 Android buildsDownload an Android arm64 build of this PR for testing. Other Android architectures🐧 Linux AppImage buildsDownload a Linux AppImage build of this PR for testing. |
|
Is the length calculating the distance in the projected 2D place between the points, or the 3D following the surface? E.g. p1(x:0, y:0, z:0) and p2(x:10, y:0, z: 10), is the distance going to be 10 or sqrt(200)? Or it's the projected line on the surface, so assuming the noisy reality, the distance would be >sqrt(200)? Personally I would assume it's the last one. But if it isn't, it would be nice to give some indication to the user what we are actually measuring. |
|
@MidnightCoder-m , @suricactus 's comment is correct, we should provide 3D length and area values. That'll need to be handled in https://github.com/opengisch/QField/blob/master/src/core/qfdistancearea.cpp where you'll need to add a boolean to handle Z values. The QgsDistanceArea class we use to calculate 2D lengths and areas does not handle Z value You'll need to rely on QgsGeometry::area3D and to individual QgsPoint::distance3D to compute lengths. |
|
@nirvn but still, is it going to calculate the shortest distance between p1 and p2 (sqrt(200) in my example), or it is going to project the measurement on the surface and calculate that distance? Because if it is measuring the shortest distance between the points, we need to ensure it's clear to the user. Also in the visual representation, the line should not be projected on the 3D surface, but stay hanging "in the air" (which I think the demo shows already). Which also brings a question about the area measurement in 3d view, what do we measure exactly? I guess there are some restrictions what we can easily achieve now. My comments should not be interpreted as feature requests, but that would be nice to be clear and explicit what we measure, both in the UI and in the upcoming documentation. |
|
@suricactus , ah got you, it's measurement from p1 to p2, we wouldn't drape the line for now. Good point on making it clear (via documentation and in QField itself). |
Description
The measurement tool now works on the 3D map view.
Key changes
Demo
Screencast.From.2026-11-17.23-14-41.mp4