Bug report #19355
$length incorrect in expressions
Status: | Closed | ||
---|---|---|---|
Priority: | High | ||
Assignee: | Hugo Mercier | ||
Category: | Expressions | ||
Affected QGIS version: | 3.5(master) | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 27183 |
Description
$length correctly calculates ellipsoidal length in a field calculator update, but shows planimetric length in the expression dialog and if used in expressions elsewhere, such as in labels.
Associated revisions
Fix $length in labels (fixes #19355)
Use the project expression scope to access project
parameters (ellipsoid and distance/area units)
Fix $length in labels (fixes #19355)
Use the project expression scope to access project
parameters (ellipsoid and distance/area units)
History
#1 Updated by Borys Jurgiel about 6 years ago
- Operating System deleted (
MacOS) - Priority changed from Normal to High
This bug is definitely high priority, and misleading labels can be even considered as indirect data corruption.
On every training I teach users how to deal with this long standing issue, what becomes a bit embarrassing... :)
#2 Updated by Hugo Mercier almost 6 years ago
- File qgis_length_bug.png added
- Affected QGIS version changed from 3.2 to 3.5(master)
- File test_length.qgz added
- File test_length.gpkg added
Attached a sample project to reproduce, with one virtual field "length" with expression "$length" and labels using "$length || ' - ' || length"
#3 Updated by Hugo Mercier almost 6 years ago
- Assignee set to Hugo Mercier
#4 Updated by Hugo Mercier almost 6 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset qgis|809196693c597eb86d1fceaec2e1ce483900adb1.