Class: QgsPointCloudDataProvider

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

Added in version 3.18.

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: attributes(), QgsDataProvider.crs(), QgsDataProvider.description(), QgsDataProvider.extent(), generateIndex(), indexingState(), QgsDataProvider.isValid(), loadIndex(), QgsDataProvider.name(), pointCount()

Class Hierarchy

Inheritance diagram of qgis.core.QgsPointCloudDataProvider

Base classes

QgsDataProvider

Abstract base class for spatial data provider implementations.

QObject

Abstract Methods

attributes

Returns the attributes available from this data provider.

generateIndex

Triggers generation of the point cloud index

indexingState

Gets the current index generation state

loadIndex

Triggers loading of the point cloud index

pointCount

Returns the total number of points available in the dataset.

Methods

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.

metadataStatistics

Returns the object containing the statistics metadata extracted from the dataset

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsPointCloudDataProvider. See the FAQ for more details.

capabilities

Returns flags containing the supported capabilities for the data provider.

createRenderer

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

index

Returns the point cloud index associated with the provider.

originalMetadata

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

polygonBounds

Returns the polygon bounds of the layer.

Static Methods

dataFormatIds

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

lasClassificationCodes

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

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

Emitted when point cloud generation state is changed

Attributes

ChangeAttributeValues

ContainSubIndexes

CreateRenderer

Indexed

Indexing

NoCapabilities

NotIndexed

ReadLayerMetadata

WriteLayerMetadata

class qgis.core.QgsPointCloudDataProvider[source]

Bases: QgsDataProvider

__init__(uri: str | None, providerOptions: QgsDataProvider.ProviderOptions, flags: Qgis.DataProviderReadFlags | Qgis.DataProviderReadFlag = Qgis.DataProviderReadFlags())

Ctor

Parameters:
class Capabilities
class Capabilities(f: QgsPointCloudDataProvider.Capabilities | QgsPointCloudDataProvider.Capability)
class Capabilities(a0: QgsPointCloudDataProvider.Capabilities)

Bases: object

class Capability

Bases: int

ChangeAttributeValues = 16
ContainSubIndexes = 8
CreateRenderer = 4
Indexed = 2
Indexing = 1
NoCapabilities = 0
NotIndexed = 0
class PointCloudIndexGenerationState

Bases: int

ReadLayerMetadata = 1
WriteLayerMetadata = 2
abstract attributes(self) QgsPointCloudAttributeCollection[source]

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

Return type:

QgsPointCloudAttributeCollection

virtual capabilities(self) QgsPointCloudDataProvider.Capabilities[source]

Returns flags containing the supported capabilities for the data provider.

Return type:

QgsPointCloudDataProvider.Capabilities

virtual createRenderer(self, configuration: Dict[str, Any] = {}) QgsPointCloudRenderer | None[source]

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, Any] = {})

Return type:

Optional[QgsPointCloudRenderer]

static dataFormatIds() Dict[int, str]

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

Return type:

Dict[int, str]

abstract generateIndex(self)[source]

Triggers generation of the point cloud index

emits indexGenerationStateChanged()

See also

index()

hasValidIndex(self) bool[source]

Returns whether provider has index which is valid

Return type:

bool

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

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

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

virtual index(self) QgsPointCloudIndex[source]

Returns the point cloud index associated with the provider.

Can be None (e.g. the index is being created)

Return type:

QgsPointCloudIndex

signal indexGenerationStateChanged(state: QgsPointCloudDataProvider.PointCloudIndexGenerationState)[source]

Emitted when point cloud generation state is changed

Parameters:

state (QgsPointCloudDataProvider.PointCloudIndexGenerationState)

abstract indexingState(self) QgsPointCloudDataProvider.PointCloudIndexGenerationState[source]

Gets the current index generation state

Return type:

QgsPointCloudDataProvider.PointCloudIndexGenerationState

static 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]

abstract loadIndex(self)[source]

Triggers loading of the point cloud index

See also

index()

metadataStatistics(self) QgsPointCloudStatistics[source]

Returns the object containing the statistics metadata extracted from the dataset

Added in version 3.26.

Return type:

QgsPointCloudStatistics

virtual originalMetadata(self) Dict[str, Any][source]

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]

abstract pointCount(self) int[source]

Returns the total number of points available in the dataset.

Return type:

int

virtual polygonBounds(self) QgsGeometry[source]

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

static translatedDataFormatIds() Dict[int, str]

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

See also

dataFormatIds()

Return type:

Dict[int, str]

static 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]