Skip to content

Measurement tool in the 3D map view - #8218

Open
MidnightCoder-m wants to merge 4 commits into
masterfrom
measurement-tool-3d
Open

MidnightCoder-m wants to merge 4 commits into
masterfrom
measurement-tool-3d

Conversation

@MidnightCoder-m

@MidnightCoder-m MidnightCoder-m commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Description

The measurement tool now works on the 3D map view.

Key changes

  • Measure mode no longer closes the 3D view, only digitize mode does.
  • With a mouse or stylus, the crosshair follows the pointer.

Demo

Screencast.From.2026-11-17.23-14-41.mp4

@qfield-fairy

qfield-fairy commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

🍎 MacOS DMG universal builds

Download a MacOS DMG universal build of this PR for testing.
(Built from commit 3477356)

📱 Android builds

Download an Android arm64 build of this PR for testing.
(Built from commit 3477356)

Other Android architectures

🐧 Linux AppImage builds

Download a Linux AppImage build of this PR for testing.
(Built from commit 3477356)

@suricactus

Copy link
Copy Markdown
Collaborator

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.

@nirvn

nirvn commented Nov 18, 2026

Copy link
Copy Markdown
Member

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

@suricactus

Copy link
Copy Markdown
Collaborator

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

@nirvn

nirvn commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants