QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
QgsPointCloudDataProvider Class Referenceabstract

Base class for providing data for QgsPointCloudLayer. More...

#include <qgspointclouddataprovider.h>

Inheritance diagram for QgsPointCloudDataProvider:
Inheritance graph
[legend]

Public Types

enum  Capability {
  NoCapabilities = 0 , ReadLayerMetadata = 1 << 0 , WriteLayerMetadata = 1 << 1 , CreateRenderer = 1 << 2 ,
  ContainSubIndexes = 1 << 3
}
 Capabilities that providers may implement. More...
 
enum  PointCloudIndexGenerationState { NotIndexed = 0 , Indexing = 1 << 0 , Indexed = 1 << 1 }
 Point cloud index state. More...
 
- Public Types inherited from QgsDataProvider
enum  DataCapability {
  NoDataCapabilities = 0 , File = 1 , Dir = 1 << 1 , Database = 1 << 2 ,
  Net = 1 << 3
}
 Used in browser model to understand which items for which providers should be populated. More...
 
enum  ProviderProperty { EvaluateDefaultValues , CustomData = 3000 }
 Properties are used to pass custom configuration options into data providers. More...
 
enum  ReadFlag {
  FlagTrustDataSource = 1 << 0 , SkipFeatureCount = 1 << 1 , FlagLoadDefaultStyle = 1 << 2 , SkipGetExtent = 1 << 3 ,
  SkipFullScan = 1 << 4 , ForceReadOnly = 1 << 5 , SkipCredentialsRequest = 1 << 6 , ParallelThreadLoading = 1 << 7
}
 Flags which control dataprovider construction. More...
 

Signals

void indexGenerationStateChanged (QgsPointCloudDataProvider::PointCloudIndexGenerationState state)
 Emitted when point cloud generation state is changed.
 
- Signals inherited from QgsDataProvider
void dataChanged ()
 Emitted whenever a change is made to the data provider which may have caused changes in the provider's data OUTSIDE of QGIS.
 
void fullExtentCalculated ()
 Emitted whenever a deferred extent calculation is completed by the provider.
 
void notify (const QString &msg)
 Emitted when the datasource issues a notification.
 

Public Member Functions

 QgsPointCloudDataProvider (const QString &uri, const QgsDataProvider::ProviderOptions &providerOptions, QgsDataProvider::ReadFlags flags=QgsDataProvider::ReadFlags())
 Ctor.
 
 ~QgsPointCloudDataProvider () override
 
virtual QgsPointCloudAttributeCollection attributes () const =0
 Returns the attributes available from this data provider.
 
virtual QgsPointCloudDataProvider::Capabilities capabilities () const
 Returns flags containing the supported capabilities for the data provider.
 
virtual QgsPointCloudRenderercreateRenderer (const QVariantMap &configuration=QVariantMap()) const
 Creates a new 2D point cloud renderer, using provider backend specific information.
 
virtual void generateIndex ()=0
 Triggers generation of the point cloud index.
 
virtual bool hasStatisticsMetadata () const
 Returns whether the dataset contains statistics metadata.
 
bool hasValidIndex () const
 Returns whether provider has index which is valid.
 
QVector< QVariantMap > identify (double maxError, const QgsGeometry &extentGeometry, const QgsDoubleRange &extentZRange=QgsDoubleRange(), int pointsLimit=1000)
 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.
 
virtual QgsPointCloudIndexindex () const
 Returns the point cloud index associated with the provider.
 
virtual PointCloudIndexGenerationState indexingState ()=0
 Gets the current index generation state.
 
virtual void loadIndex ()=0
 Triggers loading of the point cloud index.
 
virtual void loadSubIndex (int n)
 Triggers loading of the point cloud index for the n th sub index.
 
virtual QVariantList metadataClasses (const QString &attribute) const
 Returns a list of existing classes which are present for the specified attribute, taken only from the metadata of the point cloud data source.
 
virtual QVariant metadataClassStatistic (const QString &attribute, const QVariant &value, QgsStatisticalSummary::Statistic statistic) const
 Returns a statistic for one class value from the specified attribute, taken only from the metadata of the point cloud data source.
 
virtual QVariant metadataStatistic (const QString &attribute, QgsStatisticalSummary::Statistic statistic) const
 Returns a statistic for the specified attribute, taken only from the metadata of the point cloud data source.
 
QgsPointCloudStatistics metadataStatistics ()
 Returns the object containings the statistics metadata extracted from the dataset.
 
virtual QVariantMap originalMetadata () const
 Returns a representation of the original metadata included in a point cloud dataset.
 
virtual qint64 pointCount () const =0
 Returns the total number of points available in the dataset.
 
virtual QgsGeometry polygonBounds () const
 Returns the polygon bounds of the layer.
 
bool setSubsetString (const QString &subset, bool updateFeatureCount=false) override
 Set the subset string used to create a subset of features in the layer.
 
virtual QVector< QgsPointCloudSubIndex > subIndexes ()
 Returns a list of sub indexes available if the provider supports multiple indexes, empty list otherwise.
 
QString subsetString () const override
 Returns the subset definition string (typically sql) currently in use by the layer and used by the provider to limit the feature set.
 
bool supportsSubsetString () const override
 Returns true if the provider supports setting of subset strings.
 
- Public Member Functions inherited from QgsDataProvider
 QgsDataProvider (const QString &uri=QString(), const QgsDataProvider::ProviderOptions &providerOptions=QgsDataProvider::ProviderOptions(), QgsDataProvider::ReadFlags flags=QgsDataProvider::ReadFlags())
 Create a new dataprovider with the specified in the uri.
 
virtual QgsCoordinateReferenceSystem crs () const =0
 Returns the coordinate system for the data source.
 
virtual QString dataComment () const
 Returns a short comment for the data that this provider is providing access to (e.g.
 
virtual QString dataSourceUri (bool expandAuthConfig=false) const
 Gets the data source specification.
 
virtual QDateTime dataTimestamp () const
 Current time stamp of data source.
 
virtual QString description () const =0
 Returns description.
 
virtual QgsDataProviderElevationPropertieselevationProperties ()
 Returns the provider's elevation properties.
 
virtual const QgsDataProviderElevationPropertieselevationProperties () const
 Returns the provider's elevation properties.
 
virtual bool enterUpdateMode ()
 Enter update mode.
 
virtual QgsError error () const
 Gets current status error.
 
virtual QgsRectangle extent () const =0
 Returns the extent of the layer.
 
virtual QString fileRasterFilters () const
 Returns raster file filter string.
 
virtual QString fileVectorFilters () const
 Returns vector file filter string.
 
virtual Qgis::DataProviderFlags flags () const
 Returns the generic data provider flags.
 
virtual void invalidateConnections (const QString &connection)
 Invalidate connections corresponding to specified name.
 
virtual bool isValid () const =0
 Returns true if this is a valid layer.
 
virtual QgsLayerMetadata layerMetadata () const
 Returns layer metadata collected from the provider's source.
 
virtual bool leaveUpdateMode ()
 Leave update mode.
 
virtual QString name () const =0
 Returns a provider name.
 
QVariant providerProperty (int property, const QVariant &defaultValue) const
 Gets the current value of a certain provider property.
 
QVariant providerProperty (ProviderProperty property, const QVariant &defaultValue=QVariant()) const
 Gets the current value of a certain provider property.
 
virtual void reloadData ()
 Reloads the data from the source for providers with data caches to synchronize, changes in the data source, feature counts and other specific actions.
 
virtual bool renderInPreview (const QgsDataProvider::PreviewContext &context)
 Returns whether the layer must be rendered in preview jobs.
 
virtual void setDataSourceUri (const QString &uri)
 Set the data source specification.
 
virtual void setLayerOrder (const QStringList &layers)
 Reorder the list of layer names to be rendered by this provider (in order from bottom to top)
 
virtual void setListening (bool isListening)
 Set whether the provider will listen to datasource notifications If set, the provider will issue notify signals.
 
void setProviderProperty (int property, const QVariant &value)
 Allows setting arbitrary properties on the provider.
 
void setProviderProperty (ProviderProperty property, const QVariant &value)
 Allows setting arbitrary properties on the provider.
 
virtual void setSubLayerVisibility (const QString &name, bool vis)
 Set the visibility of the given sublayer name.
 
virtual void setTransformContext (const QgsCoordinateTransformContext &transformContext)
 Sets data coordinate transform context to transformContext.
 
void setUri (const QgsDataSourceUri &uri)
 Set the data source specification.
 
virtual Qgis::ProviderStyleStorageCapabilities styleStorageCapabilities () const
 Returns the style storage capabilities.
 
virtual uint subLayerCount () const
 Returns the number of layers for the current data source.
 
virtual QStringList subLayers () const
 Sub-layers handled by this provider, in order from bottom to top.
 
virtual QStringList subLayerStyles () const
 Sub-layer styles for each sub-layer handled by this provider, in order from bottom to top.
 
virtual QgsDataProviderTemporalCapabilitiestemporalCapabilities ()
 Returns the provider's temporal capabilities.
 
virtual const QgsDataProviderTemporalCapabilitiestemporalCapabilities () const
 Returns the provider's temporal capabilities.
 
virtual QDateTime timestamp () const
 Time stamp of data source in the moment when data/metadata were loaded by provider.
 
QgsCoordinateTransformContext transformContext () const
 Returns data provider coordinate transform context.
 
virtual void updateExtents ()
 Update the extents of the layer.
 
QgsDataSourceUri uri () const
 Gets the data source specification.
 
virtual bool writeLayerMetadata (const QgsLayerMetadata &metadata)
 Writes layer metadata to the underlying provider source.
 

Static Public Member Functions

static QMap< int, QString > dataFormatIds ()
 Returns the map of LAS data format ID to untranslated string value.
 
static QMap< int, QString > lasClassificationCodes ()
 Returns the map of LAS classification code to untranslated string value, corresponding to the ASPRS Standard Lidar Point Classes.
 
static QMap< int, QString > translatedDataFormatIds ()
 Returns the map of LAS data format ID to translated string value.
 
static QMap< int, QString > translatedLasClassificationCodes ()
 Returns the map of LAS classification code to translated string value, corresponding to the ASPRS Standard Lidar Point Classes.
 
- Static Public Member Functions inherited from QgsDataProvider
static QString sublayerSeparator ()
 String sequence used for separating components of sublayers strings.
 

Protected Attributes

QString mSubsetString
 String used to define a subset of the layer.
 
- Protected Attributes inherited from QgsDataProvider
QgsError mError
 Error.
 
QgsDataProvider::ReadFlags mReadFlags = QgsDataProvider::ReadFlags()
 Read flags. It's up to the subclass to respect these when needed.
 
QDateTime mTimestamp
 Timestamp of data in the moment when the data were loaded by provider.
 

Additional Inherited Members

- Protected Member Functions inherited from QgsDataProvider
void appendError (const QgsErrorMessage &message)
 Add error message.
 
void setError (const QgsError &error)
 Sets error message.
 

Detailed Description

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
Since
QGIS 3.18

Definition at line 47 of file qgspointclouddataprovider.h.

Member Enumeration Documentation

◆ Capability

Capabilities that providers may implement.

Enumerator
NoCapabilities 

Provider has no capabilities.

ReadLayerMetadata 

Provider can read layer metadata from data store.

WriteLayerMetadata 

Provider can write layer metadata to the data store. See QgsDataProvider::writeLayerMetadata()

CreateRenderer 

Provider can create 2D renderers using backend-specific formatting information. See QgsPointCloudDataProvider::createRenderer().

ContainSubIndexes 

Provider can contain multiple indexes. Virtual point cloud files for example (since QGIS 3.32)

Definition at line 55 of file qgspointclouddataprovider.h.

◆ PointCloudIndexGenerationState

Point cloud index state.

Enumerator
NotIndexed 

Provider has no index available.

Indexing 

Provider try to index the source data.

Indexed 

The index is ready to be used.

Definition at line 69 of file qgspointclouddataprovider.h.

Constructor & Destructor Documentation

◆ QgsPointCloudDataProvider()

QgsPointCloudDataProvider::QgsPointCloudDataProvider ( const QString &  uri,
const QgsDataProvider::ProviderOptions providerOptions,
QgsDataProvider::ReadFlags  flags = QgsDataProvider::ReadFlags() 
)

Ctor.

Definition at line 33 of file qgspointclouddataprovider.cpp.

◆ ~QgsPointCloudDataProvider()

QgsPointCloudDataProvider::~QgsPointCloudDataProvider ( )
overridedefault

Member Function Documentation

◆ attributes()

virtual QgsPointCloudAttributeCollection QgsPointCloudDataProvider::attributes ( ) const
pure virtual

Returns the attributes available from this data provider.

May return empty collection until pointCloudIndexLoaded() is emitted

◆ capabilities()

QgsPointCloudDataProvider::Capabilities QgsPointCloudDataProvider::capabilities ( ) const
virtual

Returns flags containing the supported capabilities for the data provider.

Definition at line 43 of file qgspointclouddataprovider.cpp.

◆ createRenderer()

QgsPointCloudRenderer * QgsPointCloudDataProvider::createRenderer ( const QVariantMap &  configuration = QVariantMap()) const
virtual

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 nullptr.

Definition at line 72 of file qgspointclouddataprovider.cpp.

◆ dataFormatIds()

QMap< int, QString > QgsPointCloudDataProvider::dataFormatIds ( )
static

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

See also
translatedDataFormatIds()

Definition at line 153 of file qgspointclouddataprovider.cpp.

◆ generateIndex()

virtual void QgsPointCloudDataProvider::generateIndex ( )
pure virtual

Triggers generation of the point cloud index.

emits indexGenerationStateChanged()

See also
index()

◆ hasStatisticsMetadata()

bool QgsPointCloudDataProvider::hasStatisticsMetadata ( ) const
virtual

Returns whether the dataset contains statistics metadata.

Since
QGIS 3.26

Definition at line 185 of file qgspointclouddataprovider.cpp.

◆ hasValidIndex()

bool QgsPointCloudDataProvider::hasValidIndex ( ) const

Returns whether provider has index which is valid.

Definition at line 50 of file qgspointclouddataprovider.cpp.

◆ identify()

QVector< QVariantMap > QgsPointCloudDataProvider::identify ( double  maxError,
const QgsGeometry extentGeometry,
const QgsDoubleRange extentZRange = QgsDoubleRange(),
int  pointsLimit = 1000 
)

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

Definition at line 295 of file qgspointclouddataprovider.cpp.

◆ index()

virtual QgsPointCloudIndex * QgsPointCloudDataProvider::index ( ) const
inlinevirtual

Returns the point cloud index associated with the provider.

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

Note
Not available in Python bindings

Definition at line 166 of file qgspointclouddataprovider.h.

◆ indexGenerationStateChanged

void QgsPointCloudDataProvider::indexGenerationStateChanged ( QgsPointCloudDataProvider::PointCloudIndexGenerationState  state)
signal

Emitted when point cloud generation state is changed.

◆ indexingState()

virtual PointCloudIndexGenerationState QgsPointCloudDataProvider::indexingState ( )
pure virtual

Gets the current index generation state.

◆ lasClassificationCodes()

QMap< int, QString > QgsPointCloudDataProvider::lasClassificationCodes ( )
static

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

See also
translatedLasClassificationCodes()

Definition at line 79 of file qgspointclouddataprovider.cpp.

◆ loadIndex()

virtual void QgsPointCloudDataProvider::loadIndex ( )
pure virtual

Triggers loading of the point cloud index.

See also
index()

◆ loadSubIndex()

virtual void QgsPointCloudDataProvider::loadSubIndex ( int  n)
inlinevirtual

Triggers loading of the point cloud index for the n th sub index.

Only applies to providers that support multiple indexes

Note
Not available in Python bindings
Since
QGIS 3.32

Definition at line 186 of file qgspointclouddataprovider.h.

◆ metadataClasses()

QVariantList QgsPointCloudDataProvider::metadataClasses ( const QString &  attribute) const
virtual

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.

Definition at line 204 of file qgspointclouddataprovider.cpp.

◆ metadataClassStatistic()

QVariant QgsPointCloudDataProvider::metadataClassStatistic ( const QString &  attribute,
const QVariant &  value,
QgsStatisticalSummary::Statistic  statistic 
) const
virtual

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.

If no matching precalculated statistic is available then an invalid variant will be returned.

Definition at line 216 of file qgspointclouddataprovider.cpp.

◆ metadataStatistic()

QVariant QgsPointCloudDataProvider::metadataStatistic ( const QString &  attribute,
QgsStatisticalSummary::Statistic  statistic 
) const
virtual

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.

If no matching precalculated statistic is available then an invalid variant will be returned.

Definition at line 192 of file qgspointclouddataprovider.cpp.

◆ metadataStatistics()

QgsPointCloudStatistics QgsPointCloudDataProvider::metadataStatistics ( )

Returns the object containings the statistics metadata extracted from the dataset.

Since
QGIS 3.26

Definition at line 228 of file qgspointclouddataprovider.cpp.

◆ originalMetadata()

QVariantMap QgsPointCloudDataProvider::originalMetadata ( ) const
virtual

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.

Definition at line 65 of file qgspointclouddataprovider.cpp.

◆ pointCount()

virtual qint64 QgsPointCloudDataProvider::pointCount ( ) const
pure virtual

Returns the total number of points available in the dataset.

◆ polygonBounds()

QgsGeometry QgsPointCloudDataProvider::polygonBounds ( ) const
virtual

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.

Definition at line 58 of file qgspointclouddataprovider.cpp.

◆ setSubsetString()

bool QgsPointCloudDataProvider::setSubsetString ( const QString &  subset,
bool  updateFeatureCount = false 
)
overridevirtual

Set the subset string used to create a subset of features in the layer.

This may be a sql where clause or any other string that can be used by the data provider to create a subset. Must be implemented in the dataprovider.

Reimplemented from QgsDataProvider.

Definition at line 363 of file qgspointclouddataprovider.cpp.

◆ subIndexes()

virtual QVector< QgsPointCloudSubIndex > QgsPointCloudDataProvider::subIndexes ( )
inlinevirtual

Returns a list of sub indexes available if the provider supports multiple indexes, empty list otherwise.

The sub indexes contain a pointer to the individual indexes which may be nullptr if not yet loaded.

Note
Not available in Python bindings
Since
QGIS 3.32

Definition at line 176 of file qgspointclouddataprovider.h.

◆ subsetString()

QString QgsPointCloudDataProvider::subsetString ( ) const
overridevirtual

Returns the subset definition string (typically sql) currently in use by the layer and used by the provider to limit the feature set.

Must be overridden in the dataprovider, otherwise returns a null QString.

Reimplemented from QgsDataProvider.

Definition at line 379 of file qgspointclouddataprovider.cpp.

◆ supportsSubsetString()

bool QgsPointCloudDataProvider::supportsSubsetString ( ) const
inlineoverridevirtual

Returns true if the provider supports setting of subset strings.

Reimplemented from QgsDataProvider.

Definition at line 345 of file qgspointclouddataprovider.h.

◆ translatedDataFormatIds()

QMap< int, QString > QgsPointCloudDataProvider::translatedDataFormatIds ( )
static

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

See also
dataFormatIds()

Definition at line 169 of file qgspointclouddataprovider.cpp.

◆ translatedLasClassificationCodes()

QMap< int, QString > QgsPointCloudDataProvider::translatedLasClassificationCodes ( )
static

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

See also
lasClassificationCodes()

Definition at line 116 of file qgspointclouddataprovider.cpp.

Member Data Documentation

◆ mSubsetString

QString QgsPointCloudDataProvider::mSubsetString
protected

String used to define a subset of the layer.

Definition at line 388 of file qgspointclouddataprovider.h.


The documentation for this class was generated from the following files: