Class: QgsMultiLineString¶
- class qgis.core.QgsMultiLineString¶
Bases:
QgsMultiCurve
Multi line string geometry collection.
QgsMultiLineString() Constructor for an empty multilinestring geometry.
QgsMultiLineString(
QgsMultiLineString
)Methods
- param g:
- param doc:
- param doc:
Default calculator for the minimal bounding box for the geometry.
Returns point at index (for geometries without child geometries - i.e. curve / point).
- rtype:
QgsMultiLineString
- rtype:
QgsMultiLineString
Reads a collection from a WKT string.
- param wkt:
- rtype:
str
Returns whether the geometry has any child geometries (
False
for point / curve,True
otherwise)- param g:
Returns the line string with the specified
index
.Re-write the measure ordinate (or add one, if it isn't already there) interpolating the measure between the supplied
start
andend
values.Updates the geometry type based on whether sub geometries contain z or m values.
Returns the sort index for the geometry, used in the
compareTo()
method to compare geometries of different types.Returns the geometry converted to the more generic curve type
QgsMultiCurve
- rtype:
bool
- addGeometry(self, g: QgsAbstractGeometry) bool ¶
- Parameters:
g (QgsAbstractGeometry) –
- Return type:
bool
- asGml2(self, doc: QDomDocument, precision: int = 17, ns: str = '', axisOrder: QgsAbstractGeometry.AxisOrder = QgsAbstractGeometry.AxisOrder.XY) QDomElement ¶
- Parameters:
doc (QDomDocument) –
precision (int = 17) –
ns (str = '') –
axisOrder (QgsAbstractGeometry.AxisOrder = QgsAbstractGeometry.AxisOrder.XY) –
- Return type:
QDomElement
- asGml3(self, doc: QDomDocument, precision: int = 17, ns: str = '', axisOrder: QgsAbstractGeometry.AxisOrder = QgsAbstractGeometry.AxisOrder.XY) QDomElement ¶
- Parameters:
doc (QDomDocument) –
precision (int = 17) –
ns (str = '') –
axisOrder (QgsAbstractGeometry.AxisOrder = QgsAbstractGeometry.AxisOrder.XY) –
- Return type:
QDomElement
- calculateBoundingBox(self) QgsRectangle ¶
Default calculator for the minimal bounding box for the geometry. Derived classes should override this method if a more efficient bounding box calculation is available.
- childCount(self) int ¶
- childGeometry(self, index: int) QgsAbstractGeometry ¶
- childPoint(self, index: int) QgsPoint ¶
Returns point at index (for geometries without child geometries - i.e. curve / point)
Note
used for vertex_iterator implementation
- clear(self)¶
- clearCache(self)¶
- clone(self) QgsMultiLineString ¶
- Return type:
- compareToSameClass(self, other: QgsAbstractGeometry) int ¶
- createEmptyWithSameType(self) QgsMultiLineString ¶
- Return type:
- fromCollectionWkt(self, wkt: str, subtypes: Iterable[QgsAbstractGeometry], defaultChildWkbType: str = '') bool ¶
Reads a collection from a WKT string.
- fromWkt(self, wkt: str) bool ¶
- Parameters:
wkt (str) –
- Return type:
bool
- geometryType(self) str ¶
- Return type:
str
- hasChildGeometries(self) bool ¶
Returns whether the geometry has any child geometries (
False
for point / curve,True
otherwise)Note
used for vertex_iterator implementation
- insertGeometry(self, g: QgsAbstractGeometry, index: int) bool ¶
- Parameters:
g (QgsAbstractGeometry) –
index (int) –
- Return type:
bool
- lineStringN(self, index: int) QgsLineString ¶
Returns the line string with the specified
index
.- Raises:
IndexError – if no line string with the specified index exists.
New in version 3.16.
- Parameters:
index (int) –
- Return type:
- measuredLine(self, start: float, end: float) QgsMultiLineString ¶
Re-write the measure ordinate (or add one, if it isn’t already there) interpolating the measure between the supplied
start
andend
values.New in version 3.36.
- Parameters:
start (float) –
end (float) –
- Return type:
- setZMTypeFromSubGeometry(self, subggeom: QgsAbstractGeometry, baseGeomType: Qgis.WkbType)¶
Updates the geometry type based on whether sub geometries contain z or m values.
- sortIndex(self) int ¶
Returns the sort index for the geometry, used in the
compareTo()
method to compare geometries of different types.New in version 3.20.
- toCurveType(self) QgsMultiCurve ¶
Returns the geometry converted to the more generic curve type
QgsMultiCurve
- Return type:
- Returns:
the converted geometry. Caller takes ownership
- wktOmitChildType(self) bool ¶
- Return type:
bool