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.
Class Hierarchy¶
Base classes¶
Abstract base class for spatial data provider implementations. |
|
Methods
Returns the attributes available from this data provider. |
|
Returns flags containing the supported capabilities for the data provider. |
|
Creates a new 2D point cloud renderer, using provider backend specific information. |
|
Triggers generation of the point cloud index |
|
Returns whether the dataset contains statistics metadata |
|
Returns whether provider has index which is valid |
|
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. |
|
Gets the current index generation state |
|
Triggers loading of the point cloud index |
|
Returns a statistic for one class value from the specified attribute, taken only from the metadata of the point cloud data source. |
|
Returns a list of existing classes which are present for the specified attribute, taken only from the metadata of the point cloud data source. |
|
Returns a statistic for the specified attribute, taken only from the metadata of the point cloud data source. |
|
Returns the object containing the statistics metadata extracted from the dataset |
|
Returns a representation of the original metadata included in a point cloud dataset. |
|
Returns the total number of points available in the dataset. |
|
Returns the polygon bounds of the layer. |
Static Methods
Returns the map of LAS data format ID to untranslated string value. |
|
Returns the map of LAS classification code to untranslated string value, corresponding to the ASPRS Standard Lidar Point Classes. |
|
Returns the map of LAS data format ID to translated string value. |
|
Returns the map of LAS classification code to translated string value, corresponding to the ASPRS Standard Lidar Point Classes. |
Signals
Emitted when point cloud generation state is changed |
Attributes
- class qgis.core.QgsPointCloudDataProvider[source]¶
Bases:
QgsDataProvider
- __init__(uri: str | None, providerOptions: QgsDataProvider.ProviderOptions, flags: Qgis.DataProviderReadFlags | Qgis.DataProviderReadFlag = Qgis.DataProviderReadFlags())
Ctor
- Parameters:
uri (Optional[str])
providerOptions (QgsDataProvider.ProviderOptions)
flags (Union[Qgis.DataProviderReadFlags, Qgis.DataProviderReadFlag] = Qgis.DataProviderReadFlags())
- class Capabilities¶
- class Capabilities(f: QgsPointCloudDataProvider.Capabilities | QgsPointCloudDataProvider.Capability)
- class Capabilities(a0: QgsPointCloudDataProvider.Capabilities)
Bases:
object
- class Capability¶
Bases:
int
- ContainSubIndexes = 8¶
- CreateRenderer = 4¶
- Indexed = 2¶
- Indexing = 1¶
- NoCapabilities = 0¶
- NotIndexed = 0¶
- class PointCloudIndexGenerationState¶
Bases:
int
- ReadLayerMetadata = 1¶
- WriteLayerMetadata = 2¶
- attributes(self) QgsPointCloudAttributeCollection [source]¶
Returns the attributes available from this data provider. May return empty collection until
pointCloudIndexLoaded()
is emitted- Return type:
- capabilities(self) QgsPointCloudDataProvider.Capabilities [source]¶
Returns flags containing the supported capabilities for the data provider.
- Return type:
- 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 ofconfiguration
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.
See also
- Return type:
Dict[int, str]
- generateIndex(self)[source]¶
Triggers generation of the point cloud index
emits
indexGenerationStateChanged()
See also
index()
- hasStatisticsMetadata(self) bool [source]¶
Returns whether the dataset contains statistics metadata
Added in version 3.26.
- Return type:
bool
- 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 extentgeometry
in the 2D plane and a rangeextentZRange
for z values. The function will try to limit the number of points returned topointsLimit
pointsNote
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
- signal indexGenerationStateChanged(state: QgsPointCloudDataProvider.PointCloudIndexGenerationState)[source]¶
Emitted when point cloud generation state is changed
- Parameters:
state (QgsPointCloudDataProvider.PointCloudIndexGenerationState)
- indexingState(self) QgsPointCloudDataProvider.PointCloudIndexGenerationState [source]¶
Gets the current index generation state
- static lasClassificationCodes() Dict[int, str] ¶
Returns the map of LAS classification code to untranslated string value, corresponding to the ASPRS Standard Lidar Point Classes.
See also
- Return type:
Dict[int, str]
- metadataClassStatistic(self, attribute: str | None, value: Any, statistic: Qgis.Statistic) Any [source]¶
Returns a statistic for one class
value
from the specifiedattribute
, 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 somestatistic
values may be available.- Raises:
ValueError – if no matching precalculated statistic is available for the attribute.
- Parameters:
attribute (Optional[str])
value (Any)
statistic (Qgis.Statistic)
- Return type:
Any
- metadataClasses(self, attribute: str | None) List[Any] [source]¶
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 (Optional[str])
- Return type:
List[Any]
- metadataStatistic(self, attribute: str | None, statistic: Qgis.Statistic) Any [source]¶
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:
attribute (Optional[str])
statistic (Qgis.Statistic)
- Return type:
Any
- metadataStatistics(self) QgsPointCloudStatistics [source]¶
Returns the object containing the statistics metadata extracted from the dataset
Added in version 3.26.
- Return type:
- 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]
- pointCount(self) int [source]¶
Returns the total number of points available in the dataset.
- Return type:
int
- 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:
- static translatedDataFormatIds() Dict[int, str] ¶
Returns the map of LAS data format ID to translated string value.
See also
- 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.
See also
- Return type:
Dict[int, str]