Class: QgsMultiLineString

Multi line string geometry collection.

Class Hierarchy

Inheritance diagram of qgis.core.QgsMultiLineString

Base classes

QgsMultiCurve

Multi curve geometry collection.

QgsGeometryCollection

Geometry collection.

QgsAbstractGeometry

Abstract base class for all geometries.

Abstract Methods

toCurveType

Returns the geometry converted to the more generic curve type QgsMultiCurve

Methods

lineStringN

Returns the line string with the specified index.

measuredLine

Re-write the measure ordinate (or add one, if it isn't already there) interpolating the measure between the supplied start and end values.

class qgis.core.QgsMultiLineString[source]

Bases: QgsMultiCurve

__init__()

Constructor for an empty multilinestring geometry.

__init__(linestrings: Iterable[QgsLineString])

Constructor for a multilinestring containing the specified linestrings.

The linestrings will be internally cloned.

Added in version 3.38.

Parameters:

linestrings (Iterable[QgsLineString])

__init__(linestrings: Iterable[QgsLineString])

Constructor for a multilinestring containing the specified linestrings.

Ownership of the linestrings will be transferred to the multilinestring.

Added in version 3.38.

Parameters:

linestrings (Iterable[QgsLineString])

__init__(a0: QgsMultiLineString)
Parameters:

a0 (QgsMultiLineString)

lineStringN(self, index: int) QgsLineString[source]

Returns the line string with the specified index.

Raises:

IndexError – if no line string with the specified index exists.

Added in version 3.16.

Parameters:

index (int)

Return type:

QgsLineString

measuredLine(self, start: float, end: float) QgsMultiLineString | None[source]

Re-write the measure ordinate (or add one, if it isn’t already there) interpolating the measure between the supplied start and end values.

Added in version 3.36.

Parameters:
  • start (float)

  • end (float)

Return type:

Optional[QgsMultiLineString]

abstract toCurveType(self) QgsMultiCurve | None[source]

Returns the geometry converted to the more generic curve type QgsMultiCurve

Return type:

Optional[QgsMultiCurve]

Returns:

the converted geometry. Caller takes ownership