Class: QgsPointCloudDataProvider

class qgis.core.QgsPointCloudDataProvider(uri: str, providerOptions: QgsDataProvider.ProviderOptions, flags: Union[QgsDataProvider.ReadFlags, QgsDataProvider.ReadFlag] = QgsDataProvider.ReadFlags())

Bases: QgsDataProvider

Ctor

Base class for providing data for QgsPointCloudLayer

Responsible for reading native point cloud data and returning the indexed data.

Note

The API is considered EXPERIMENTAL and can be changed without a notice

New in version 3.18.

Parameters
class Capabilities

Bases: sip.wrapper

QgsPointCloudDataProvider.Capabilities(Union[QgsPointCloudDataProvider.Capabilities, QgsPointCloudDataProvider.Capability]) QgsPointCloudDataProvider.Capabilities(QgsPointCloudDataProvider.Capabilities)

class Capability

Bases: int

CreateRenderer = 4
Indexed = 2
Indexing = 1
NoCapabilities = 0
NotIndexed = 0
class PointCloudIndexGenerationState

Bases: int

ReadLayerMetadata = 1
WriteLayerMetadata = 2
appendError(self, message: QgsErrorMessage)

Add error message

attributes(self)QgsPointCloudAttributeCollection

Returns the attributes available from this data provider. May return empty collection until pointCloudIndexLoaded() is emitted

Return type

QgsPointCloudAttributeCollection

capabilities(self)QgsPointCloudDataProvider.Capabilities

Returns flags containing the supported capabilities for the data provider.

Return type

QgsPointCloudDataProvider.Capabilities

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
createRenderer(self, configuration: Dict[str, Any] = {})QgsPointCloudRenderer

Creates a new 2D point cloud renderer, using provider backend specific information.

The configuration map can be used to pass provider-specific configuration maps to the provider to allow customization of the returned renderer. Support and format of configuration varies by provider.

When called with an empty configuration map the provider’s default renderer will be returned.

This method returns a new renderer and the caller takes ownership of the returned object.

Only providers which report the CreateRenderer capability will return a 2D renderer. Other providers will return None.

Parameters

configuration (Dict[str) –

Return type

QgsPointCloudRenderer

customEvent(self, QEvent)
dataFormatIds()Dict[int, str]

Returns the map of LAS data format ID to untranslated string value.

Return type

Dict[int, str]

disconnectNotify(self, QMetaMethod)
generateIndex(self)

Triggers generation of the point cloud index

emits indexGenerationStateChanged()

sa index()

hasValidIndex(self)bool

Returns whether provider has index which is valid

Return type

bool

identify(self, maxErrorInMapCoords: float, extentGeometry: QgsGeometry, extentZRange: QgsDoubleRange = QgsDoubleRange(), pointsLimit: int = 1000)List

Returns the list of points of the point cloud according to a zoom level defined by maxError (in layer coordinates), an extent geometry in the 2D plane and a range extentZRange for z values. The function will try to limit the number of points returned to pointsLimit points

maxErrorPixels : maximum accepted error factor in pixels

Note

this function does not handle elevation properties and you need to change elevation coordinates yourself after returning from the function

Parameters
  • maxErrorInMapCoords (float) –

  • extentGeometry (QgsGeometry) –

  • extentZRange (QgsDoubleRange = QgsDoubleRange()) –

  • pointsLimit (int = 1000) –

Return type

List

indexGenerationStateChanged

Emitted when point cloud generation state is changed [signal]

Parameters

state (QgsPointCloudDataProvider.PointCloudIndexGenerationState) –

indexingState(self)QgsPointCloudDataProvider.PointCloudIndexGenerationState

Gets the current index generation state

Return type

QgsPointCloudDataProvider.PointCloudIndexGenerationState

isSignalConnected(self, QMetaMethod)bool
lasClassificationCodes()Dict[int, str]

Returns the map of LAS classification code to untranslated string value, corresponding to the ASPRS Standard Lidar Point Classes.

Return type

Dict[int, str]

loadIndex(self)

Triggers loading of the point cloud index

sa index()

metadataClassStatistic(self, attribute: str, value: Any, statistic: QgsStatisticalSummary.Statistic)object

Returns a statistic for one class value from the specified attribute, taken only from the metadata of the point cloud data source. This method will not perform any statistical calculations, rather it will return only precomputed class statistics which are included in the data source’s metadata. Not all data sources include this information in the metadata, and even for sources with statistical metadata only some statistic values may be available.

Raises

ValueError – if no matching precalculated statistic is available for the attribute.

Parameters
Return type

object

metadataClasses(self, attribute: str)List[Any]

Returns a list of existing classes which are present for the specified attribute, taken only from the metadata of the point cloud data source.

This method will not perform any classification or scan for available classes, rather it will return only precomputed classes which are included in the data source’s metadata. Not all data sources include this information in the metadata.

Parameters

attribute (str) –

Return type

List[Any]

metadataStatistic(self, attribute: str, statistic: QgsStatisticalSummary.Statistic)object

Returns a statistic for the specified attribute, taken only from the metadata of the point cloud data source.

This method will not perform any statistical calculations, rather it will return only precomputed attribute statistics which are included in the data source’s metadata. Not all data sources include this information in the metadata, and even for sources with statistical metadata only some statistic values may be available.

Raises

ValueError – if no matching precalculated statistic is available for the attribute.

Parameters
Return type

object

originalMetadata(self)Dict[str, Any]

Returns a representation of the original metadata included in a point cloud dataset.

This is a free-form dictionary of values, the contents and structure of which will vary by provider and dataset.

Return type

Dict[str, Any]

pointCount(self)int

Returns the total number of points available in the dataset.

Return type

int

polygonBounds(self)QgsGeometry

Returns the polygon bounds of the layer. The CRS of the returned geometry will match the provider’s crs().

This method will return the best approximation for the actual bounds of points contained in the dataset available from the provider’s metadata. This may match the bounding box rectangle returned by extent(), or for some datasets a “convex hull” style polygon representing a more precise bounds will be returned.

This method will not attempt to calculate the data bounds, rather it will return only whatever precomputed bounds are included in the data source’s metadata.

Return type

QgsGeometry

receivers(self, PYQT_SIGNAL)int
sender(self)QObject
senderSignalIndex(self)int
setError(self, error: QgsError)

Sets error message

timerEvent(self, QTimerEvent)
translatedDataFormatIds()Dict[int, str]

Returns the map of LAS data format ID to translated string value.

See also

dataFormatIds()

Return type

Dict[int, str]

translatedLasClassificationCodes()Dict[int, str]

Returns the map of LAS classification code to translated string value, corresponding to the ASPRS Standard Lidar Point Classes.

Return type

Dict[int, str]