QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Types | Signals | Public Member Functions | Static Public Member Functions | 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 }
 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
}
 Flags which control dataprovider construction. More...
 

Signals

void indexGenerationStateChanged (QgsPointCloudDataProvider::PointCloudIndexGenerationState state)
 Emitted when point cloud generation state is changed. More...
 
- 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. More...
 
void fullExtentCalculated ()
 Emitted whenever a deferred extent calculation is completed by the provider. More...
 
void notify (const QString &msg)
 Emitted when the datasource issues a notification. More...
 

Public Member Functions

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

Static Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from QgsDataProvider
void appendError (const QgsErrorMessage &message)
 Add error message. More...
 
void setError (const QgsError &error)
 Sets error message. More...
 
- Protected Attributes inherited from QgsDataProvider
QgsError mError
 Error. More...
 
QgsDataProvider::ReadFlags mReadFlags = QgsDataProvider::ReadFlags()
 Read flags. It's up to the subclass to respect these when needed. More...
 
QDateTime mTimestamp
 Timestamp of data in the moment when the data were loaded by provider. More...
 

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 46 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().

Definition at line 54 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 67 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 32 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 42 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 63 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 142 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 174 of file qgspointclouddataprovider.cpp.

◆ hasValidIndex()

bool QgsPointCloudDataProvider::hasValidIndex ( ) const

Returns whether provider has index which is valid.

Definition at line 47 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 275 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 164 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 68 of file qgspointclouddataprovider.cpp.

◆ loadIndex()

virtual void QgsPointCloudDataProvider::loadIndex ( )
pure virtual

Triggers loading of the point cloud index.

See also
index()

◆ 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 189 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 199 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 179 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 210 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 58 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 53 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 335 of file qgspointclouddataprovider.cpp.

◆ 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 349 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 323 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 158 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 105 of file qgspointclouddataprovider.cpp.


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