not QgsPointXY as indicated by the documentation
Also add support for constructing QgsLineString using arrays of
arrays of floats, given that we're having to hand-roll sip conversion
code anyway!
Now the following is supported:
line = QgsLineString([[1,2], [3,4], [5,6]])
which is much nicer and more "pythonic" then the explicit
QgsPoint/QgsPointXY sequences!
Fixes#43200
Returns a reference to the simplest lossless representation of this geometry,
e.g. if the geometry is a multipart geometry type with a single member geometry,
a reference to that part will be returned.
This method employs the following logic:
- For multipart geometries containing a single part only a direct reference to that part will be returned.
- For compound curve geometries containing a single curve only a direct reference to that curve will be returned.
This method returns a reference only, and does not involve any geometry cloning.
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.
Allows for comparison of geometry objects, e.g. to allow for stable
sorting of them.
Ported from the GEOS equivalent method, but with addition of support
for M values and curved geometry types
to transform the vertices of a QgsAbstractGeometry
E.g.
class Transformer(QgsAbstractGeometryTransformer):
def transformPoint(self, x, y, z, m):
return True, x * 2, y + 1, z, m
transformer = Transformer()
g = QgsGeometry.fromWkt('LineString(3 0, 10 0, 10 10)')
g.get().transform(transformer)
print(g.asWkt()) # 'LineString (6 1, 20 1, 20 11)'