QGIS API Documentation 3.38.0-Grenoble (exported)
|
Base class for providing data for QgsPointCloudLayer. More...
#include <qgspointclouddataprovider.h>
Public Types | |
typedef QFlags< Capability > | Capabilities |
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 | 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... | |
typedef QFlags< ReadFlag > | ReadFlags |
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 QgsPointCloudRenderer * | createRenderer (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 QgsPointCloudIndex * | index () 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, Qgis::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, Qgis::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 containing 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 QgsDataProviderElevationProperties * | elevationProperties () |
Returns the provider's elevation properties. | |
virtual const QgsDataProviderElevationProperties * | elevationProperties () 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 QgsBox3D | extent3D () const |
Returns the 3D 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 QString | htmlMetadata () const |
Obtain a formatted HTML string containing assorted metadata for this data provider. | |
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. | |
void | setUri (const QString &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 QgsDataProviderTemporalCapabilities * | temporalCapabilities () |
Returns the provider's temporal capabilities. | |
virtual const QgsDataProviderTemporalCapabilities * | temporalCapabilities () 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. | |
Base class for providing data for QgsPointCloudLayer.
Responsible for reading native point cloud data and returning the indexed data.
Definition at line 46 of file qgspointclouddataprovider.h.
typedef QFlags< Capability > QgsPointCloudDataProvider::Capabilities |
Definition at line 63 of file qgspointclouddataprovider.h.
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 54 of file qgspointclouddataprovider.h.
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 68 of file qgspointclouddataprovider.h.
QgsPointCloudDataProvider::QgsPointCloudDataProvider | ( | const QString & | uri, |
const QgsDataProvider::ProviderOptions & | providerOptions, | ||
QgsDataProvider::ReadFlags | flags = QgsDataProvider::ReadFlags() |
||
) |
Ctor.
Definition at line 33 of file qgspointclouddataprovider.cpp.
|
overridedefault |
|
pure virtual |
Returns the attributes available from this data provider.
May return empty collection until pointCloudIndexLoaded() is emitted
|
virtual |
Returns flags containing the supported capabilities for the data provider.
Definition at line 43 of file qgspointclouddataprovider.cpp.
|
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.
|
static |
Returns the map of LAS data format ID to untranslated string value.
Definition at line 153 of file qgspointclouddataprovider.cpp.
|
pure virtual |
|
virtual |
Returns whether the dataset contains statistics metadata.
Definition at line 185 of file qgspointclouddataprovider.cpp.
bool QgsPointCloudDataProvider::hasValidIndex | ( | ) | const |
Returns whether provider has index which is valid.
Definition at line 50 of file qgspointclouddataprovider.cpp.
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
Definition at line 294 of file qgspointclouddataprovider.cpp.
|
inlinevirtual |
Returns the point cloud index associated with the provider.
Can be nullptr (e.g. the index is being created)
Definition at line 165 of file qgspointclouddataprovider.h.
|
signal |
Emitted when point cloud generation state is changed.
|
pure virtual |
Gets the current index generation state.
|
static |
Returns the map of LAS classification code to untranslated string value, corresponding to the ASPRS Standard Lidar Point Classes.
Definition at line 79 of file qgspointclouddataprovider.cpp.
|
pure virtual |
Triggers loading of the point cloud index.
|
inlinevirtual |
Triggers loading of the point cloud index for the n th sub index.
Only applies to providers that support multiple indexes
Definition at line 185 of file qgspointclouddataprovider.h.
|
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.
|
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.
|
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.
QgsPointCloudStatistics QgsPointCloudDataProvider::metadataStatistics | ( | ) |
Returns the object containing the statistics metadata extracted from the dataset.
Definition at line 228 of file qgspointclouddataprovider.cpp.
|
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.
|
pure virtual |
Returns the total number of points available in the dataset.
|
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.
|
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 362 of file qgspointclouddataprovider.cpp.
|
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.
Definition at line 175 of file qgspointclouddataprovider.h.
|
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 378 of file qgspointclouddataprovider.cpp.
|
inlineoverridevirtual |
Returns true
if the provider supports setting of subset strings.
Reimplemented from QgsDataProvider.
Definition at line 344 of file qgspointclouddataprovider.h.
|
static |
Returns the map of LAS data format ID to translated string value.
Definition at line 169 of file qgspointclouddataprovider.cpp.
|
static |
Returns the map of LAS classification code to translated string value, corresponding to the ASPRS Standard Lidar Point Classes.
Definition at line 116 of file qgspointclouddataprovider.cpp.
|
protected |
String used to define a subset of the layer.
Definition at line 387 of file qgspointclouddataprovider.h.