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
Add error message
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.
Returns the map of LAS data format ID to untranslated string value.
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 extentgeometry
in the 2D plane and a rangeextentZRange
for z values.Gets the current index generation state
Returns the map of LAS classification code to untranslated string value, corresponding to the ASPRS Standard Lidar Point Classes.
Triggers loading of the point cloud index
Returns a statistic for one class
value
from the specifiedattribute
, 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 containings 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.
Sets error message
- param subset:
- rtype:
str
- rtype:
bool
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
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
Attributes
- 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:
- capabilities(self) QgsPointCloudDataProvider.Capabilities ¶
Returns flags containing the supported capabilities for the data provider.
- Return type:
- 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 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) –
- Return type:
- customEvent(self, QEvent)¶
- dataFormatIds() Dict[int, str] ¶
Returns the map of LAS data format ID to untranslated string value.
See also
- Return type:
Dict[int, str]
- disconnectNotify(self, QMetaMethod)¶
- generateIndex(self)¶
Triggers generation of the point cloud index
emits
indexGenerationStateChanged()
sa
index()
- hasStatisticsMetadata(self) bool ¶
Returns whether the dataset contains statistics metadata
New in version 3.26.
- Return type:
bool
- 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 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
- 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
- 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.
See also
- 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 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 (str) –
value (Any) –
statistic (QgsStatisticalSummary.Statistic) –
- 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:
attribute (str) –
statistic (QgsStatisticalSummary.Statistic) –
- Return type:
object
- metadataStatistics(self) QgsPointCloudStatistics ¶
Returns the object containings the statistics metadata extracted from the dataset
New in version 3.26.
- Return type:
- 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:
- receivers(self, PYQT_SIGNAL) int ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setSubsetString(self, subset: str, updateFeatureCount: bool = False) bool ¶
- Parameters:
subset (str) –
updateFeatureCount (bool = False) –
- Return type:
bool
- subsetString(self) str ¶
- Return type:
str
- supportsSubsetString(self) bool ¶
- Return type:
bool
- timerEvent(self, QTimerEvent)¶
- translatedDataFormatIds() Dict[int, str] ¶
Returns the map of LAS data format ID to translated string value.
See also
- 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.
See also
- Return type:
Dict[int, str]