Since z coordinates can represent potentially any height
unit and reference point, it's not safe to assume that they
always represent height in metres relative to the ellipsoid.
Instead, leave z values untouched by default with geometry
transforms, and make transforming z an optional parameter
Refs #14702
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.
- removes storage of bounding box from QgsPointV2 (gives significant
decrease in size of object)
- more efficient calculation of bounding box for linestrings
Additionally, this commit moves the bounding box invalidation to a
virtual QgsAbstractGeometryV2::clearCache() method, so that other
non-bounding box caches can also be cleared when the geometry
is modified.
Now all classes and members are either exposed to bindings or marked
as "not available in Python bindings" in the docs.
Drop test thresholds to 0. Now it should be much easier to determine
what missing members have been added which are causing test
failures.
- Setting exterior ring will force all interior rings to match
dimensionality of exterior ring
- add equality operator
- use correct WKB types for rings when creating polygon from WKB
- segmentize curves when setting exterior ring with curved segments
- fix export to GML2/3 (should use LinearRing, not LineString as
ring element tag)
- fixes for handling Polygon25D
- add QgsAbstractGeometryV2::convertTo( QgsWKBTypes::Type type ) for
easy conversion between geometry types
- fix crash when calculating perimeter with no exterior ring
- ensure that added rings respect dimensionality of polygon (avoids
issues such as polygons with z having a ring without z, or a
Polygon25D with LineStringZ rings)
- if a curved ring is added to a polygon then a segmentized version
of the ring is used (can't have a Polygon with a CircularString
ring)
- when calling setInteriorRings, make sure empty rings are skipped
and that all rings are converted to correct type for polygon
- don't crash when requesting or removing interior ring with
index < 0
- fix incorrect centroid calculation (was always returning 0,0)
- fix closestSegment when numPoints < 2
- fix broken leftOf calculation for closestSegment
- area calculation when numPoints < 2
Plus add more unit tests
- prevent creation of a QgsPointV2 with a non-point WKB type
- fix bounding box was not invalidated for some modification routines
- if WKT type is PointZ/M/ZM and not enough coordinates specified,
initialise extra coordinates to 0
- when creating geometry from WKT, upgrade dimensionality of geometry
if coordinates are 3/4 dimensional
- match dimensionality of collections to child dimensionality
- fix area of curves was non-zero if curve is closed
- don't consider m values when testing for curve closedness
- add unit tests for closedness
- add unit tests for CircularStrings, CompoundCurves, CurvePolygon,
tests with geometries with Z/M values
Split length from perimeter calculation in geometry API, as
returning perimeter for length for polygons is misleading and
results in incorrect length/perimeter calculations for mixed
geometry collections.
Enable length & perimeter unit tests against reference geometries.
Now the length & perimeter values match those calculated by
PostGIS.