Class: QgsMultiPoint

class qgis.core.QgsMultiPoint

Bases: QgsGeometryCollection

Multi point geometry collection.

QgsMultiPoint() Constructor for an empty multipoint geometry.

QgsMultiPoint(points: Sequence[Union[QgsPoint, QgsPointXY, Sequence[float]]]) Construct a multipoint from a sequence of points (QgsPoint objects, QgsPointXY objects, or sequences of float values).

The multipoint Z and M type will be set based on the type of the first point in the sequence.

New in version 3.34.

QgsMultiPoint(x: Iterable[float], y: Iterable[float], z: Iterable[float] = [], m: Iterable[float] = []) Construct a multipoint from arrays of coordinates. If the z or m arrays are non-empty then the resultant multipoint will have z and m types accordingly. This constructor is more efficient then calling addGeometry() repeatedly.

If the sizes of x and y are non-equal then the resultant multipoint will be created using the minimum size of these arrays.

New in version 3.34.

QgsMultiPoint(QgsMultiPoint)

Methods

addGeometry

param g:

asGml2

param doc:

asGml3

param doc:

boundary

rtype:

QgsAbstractGeometry

calculateBoundingBox

Default calculator for the minimal bounding box for the geometry.

calculateBoundingBox3D

childCount

childGeometry

childPoint

Returns point at index (for geometries without child geometries - i.e. curve / point).

clear

clearCache

clone

rtype:

QgsMultiPoint

compareToSameClass

createEmptyWithSameType

rtype:

QgsMultiPoint

fromCollectionWkt

Reads a collection from a WKT string.

fromWkt

param wkt:

geometryType

rtype:

str

hasChildGeometries

Returns whether the geometry has any child geometries (False for point / curve, True otherwise)

insertGeometry

param g:

isValid

param flags:

nCoordinates

rtype:

int

pointN

Returns the point with the specified index.

segmentLength

param startVertex:

setZMTypeFromSubGeometry

Updates the geometry type based on whether sub geometries contain z or m values.

sortIndex

Returns the sort index for the geometry, used in the compareTo() method to compare geometries of different types.

toCurveType

rtype:

QgsMultiPoint

vertexNumberFromVertexId

param id:

wktOmitChildType

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

boundary(self) QgsAbstractGeometry
Return type:

QgsAbstractGeometry

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.

calculateBoundingBox3D(self) QgsBox3D
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) QgsMultiPoint
Return type:

QgsMultiPoint

compareToSameClass(self, other: QgsAbstractGeometry) int
createEmptyWithSameType(self) QgsMultiPoint
Return type:

QgsMultiPoint

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:
Return type:

bool

isValid(self, flags: Qgis.GeometryValidityFlags | Qgis.GeometryValidityFlag = Qgis.GeometryValidityFlags()) Tuple[bool, str]
Parameters:

flags (Union[Qgis.GeometryValidityFlags) –

Return type:

Tuple[bool, str]

nCoordinates(self) int
Return type:

int

pointN(self, index: int) QgsPoint

Returns the point with the specified index.

Raises:

IndexError – if no point with the specified index exists.

New in version 3.16.

Parameters:

index (int) –

Return type:

QgsPoint

segmentLength(self, startVertex: QgsVertexId) float
Parameters:

startVertex (QgsVertexId) –

Return type:

float

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) QgsMultiPoint
Return type:

QgsMultiPoint

vertexNumberFromVertexId(self, id: QgsVertexId) int
Parameters:

id (QgsVertexId) –

Return type:

int

wktOmitChildType(self) bool
Return type:

bool