A port of the equivalent method from GEOS, but with added support
for curved geometries and M values
Reorganizes the geometry into a normalized form (or "canonical" form).
Polygon rings will be rearranged so that their starting vertex is
the lower left and ring orientation follows the right hand rule, collections
are ordered by geometry type, and other normalization techniques are applied.
The resultant geometry will be geometrically equivalent to the original geometry.
Unlike QgsGeometry::asQPolygonF, this allows for correct handling
of multipolygons and rings, etc.
And potentially, the generated QPainterPaths could use arc segments
instead of segmentizing geometries. In fact, there's been disabled
code which seems to do this in place since the new geometry engine
was introduced back in 2.10! TODO: check if this code works correctly...
For non-point geometry subclasses (points are always valid!) we
now cache the results of a geometry validity check. Subsequent
checks utilise the cached result wherever possible.
Because QgsGeometry/QgsFeature objects are implicitly shared, this
means that we avoid a *lot* of duplicate validity checks as
features and geometries are thrown around during processing model
execution.
For the c++ api dox this expands to "\c nullptr" (the
\c directive indicates a code literal value), and for sipify/Python
it expands to ``None`` (`` is sphinx annotation for literal values)
Makes for nicer dox for both c++ and Python!
- len(QgsCurve) returns number of points in curve
- raise IndexErrors when calling pointN, xAt, yAt, zAt, mAt, setXAt, setYAt,
setMAt, setZAt with invalid vertex indices
- Add [] getter for retrieving specific vertices, eg. ls[0] returns QgsPoint(...)
- Add [] setter for setting specific (existing) vertices, e.g. ls[1] = QgsPoint(1,2)
- Add del support for removing vertices, e.g. del ls[1] removes the second vertex
Because:
- Exactly follows curves and doesn't require segmentizing input geometry
- Also interpolates z/m values if they are present in input geometry
- Is faster
Returns a new curve representing a substring of a curve, from
a start distance and end distance.
If z or m values are present, the output z and m will be interpolated using
the existing vertices' z or m values.
Handles curved geometries without loss.