implicitly shared copy of an internal cache instead of recreating the
coordinate sequence again and again.
Improves performance of the nodetool on large features a lot (refs #13963)
Also introduce Qgs(Coordinate|Ring|Point)SequenceV2 typedefs.
Test has revealed that the current algorithm used for ellipsoidal
calculations is unstable when measuring small very areas (eg < 1m2)
For now, modify the test to use larger areas
Also add unit tests for measure tool length and area measurement
to ensure they return the same results as field calculator
and identify tool
Refs #13209, #4252
ton of available area units (eg m2, km2, mi2, ft2, yd2, ha, ac,
etc)
Adds a new option in both the QGIS setting and project properties to
set the units used for area measurements. Just like the distance
setting, this defaults to the units set in QGIS options, but can
then be overridden for specific projects.
The setting is respected for area calculations in:
- Attribute table field update bar
- Field calculator calculations
- Identify tool derived length and perimeter values
Also adds unit tests to ensure that area calculated by attribute table
update bar, field calculator and identify tool are consistent wrt
ellipsoidal calculations and area units.
TODO: make measure tool respect area setting
(refs #13209, #4252 and fixes#12939, #2402, #4857)
Adds a new option in project properties to set the units used for
distance measurements. This setting defaults to the units set in
QGIS options, but can then be overridden for specific projects.
The setting is respected for length and perimeter calculations in:
- Attribute table field update bar
- Field calculator calculations
- Identify tool derived length and perimeter values
- Default unit shown in measure dialog
Also adds unit tests to ensure that length and perimeter calculated
by attribute table update bar, field calculator and identify tool
are consistent wrt ellipsoidal calculations and distance units.
(refs #13209, #12939, #2402, #4857, #4252)
- avoid Q_FOREACH( ..., QMap.values() ) as it allocates an unnecessary
list
- use .endsWith( ... , Qt::CaseInsensitive) instead of
.lower().endsWith( ... ) as it avoids an extra QString allocation
calculations for $length, $area, $perimeter (refs #13209)
ie, the default is now to use planimeteric calculations unless
a geomCalculator has been explicitly set