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¶
Base classes¶
Abstract base class for spatial data provider implementations. |
|
Abstract Methods
Returns the attributes available from this data provider. |
|
Triggers generation of the point cloud index |
|
Gets the current index generation state |
|
Triggers loading of the point cloud index |
|
Returns the total number of points available in the dataset. |
Methods
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. |
|
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.
Returns flags containing the supported capabilities for the data provider. |
|
Creates a new 2D point cloud renderer, using provider backend specific information. |
|
Returns the point cloud index associated with the provider. |
|
Returns a representation of the original metadata included in a point cloud 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
- 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:
- virtual capabilities(self) QgsPointCloudDataProvider.Capabilities [source]¶
Returns flags containing the supported capabilities for the data provider.
- Return type:
- 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 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]
- abstract generateIndex(self)[source]¶
Triggers generation of the point cloud index
emits
indexGenerationStateChanged()
See also
- 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
- 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:
- 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
- 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]
- metadataStatistics(self) QgsPointCloudStatistics [source]¶
Returns the object containing the statistics metadata extracted from the dataset
Added in version 3.26.
- Return type:
- 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:
- 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]