Class: QgsPointCloudDataProvider

class qgis.core.QgsPointCloudDataProvider

Bases: QgsDataProvider

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.

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

Methods

appendError

Add error message

attributes

Returns the attributes available from this data provider.

capabilities

Returns flags containing the supported capabilities for the data provider.

childEvent

connectNotify

createRenderer

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

customEvent

dataFormatIds

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

disconnectNotify

generateIndex

Triggers generation of the point cloud index

hasValidIndex

Returns whether provider has index which is valid

identify

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.

indexingState

Gets the current index generation state

isSignalConnected

lasClassificationCodes

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

loadIndex

Triggers loading of the point cloud index

metadataClassStatistic

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

metadataClasses

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

metadataStatistic

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

originalMetadata

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

pointCount

Returns the total number of points available in the dataset.

polygonBounds

Returns the polygon bounds of the layer.

receivers

sender

senderSignalIndex

setError

Sets error message

timerEvent

translatedDataFormatIds

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

translatedLasClassificationCodes

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

Signals

indexGenerationStateChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

Attributes

CreateRenderer

Indexed

Indexing

NoCapabilities

NotIndexed

ReadLayerMetadata

WriteLayerMetadata

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

Bases: sip.wrapper

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

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

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]