QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
QgsVectorTileDataProvider Class Referenceabstract

Base class for vector tile layer data providers. More...

#include <qgsvectortiledataprovider.h>

Inheritance diagram for QgsVectorTileDataProvider:
Inheritance graph
[legend]

Public Member Functions

 QgsVectorTileDataProvider (const QgsVectorTileDataProvider &other)
 
 QgsVectorTileDataProvider (const QString &uri, const QgsDataProvider::ProviderOptions &providerOptions, Qgis::DataProviderReadFlags flags)
 Constructor for QgsVectorTileDataProvider, with the specified uri.
 
virtual QgsVectorTileDataProviderclone () const =0
 Returns a clone of the data provider.
 
QgsRectangle extent () const override
 Returns the extent of the layer.
 
QgsVectorTileDataProvideroperator= (const QgsVectorTileDataProvider &other)=delete
 
virtual Qgis::VectorTileProviderCapabilities providerCapabilities () const
 Returns flags containing the supported capabilities of the data provider.
 
virtual Qgis::VectorTileProviderFlags providerFlags () const
 Returns flags reflecting the behavior of the data provider.
 
virtual QgsVectorTileRawData readTile (const QgsTileMatrixSet &tileMatrixSet, const QgsTileXYZ &id, QgsFeedback *feedback=nullptr) const =0
 Returns raw tile data for a single tile.
 
virtual QList< QgsVectorTileRawDatareadTiles (const QgsTileMatrixSet &tileMatrixSet, const QVector< QgsTileXYZ > &tiles, QgsFeedback *feedback=nullptr, Qgis::RendererUsage usage=Qgis::RendererUsage::Unknown) const =0
 Returns raw tile data for a range of tiles.
 
bool renderInPreview (const QgsDataProvider::PreviewContext &context) override
 Returns whether the layer must be rendered in preview jobs.
 
virtual QString sourcePath () const =0
 Returns the source path for the data.
 
virtual QgsStringMap sourcePaths () const
 Returns the list of source paths for the data.
 
virtual QVariantMap spriteDefinition () const
 Returns the sprite definition for the provider, if available.
 
virtual QImage spriteImage () const
 Returns the sprite image for the provider, if available.
 
virtual QVariantMap styleDefinition () const
 Returns the style definition for the provider, if available.
 
virtual QString styleUrl () const
 Returns the URL for the provider style, if available.
 
virtual bool supportsAsync () const
 Returns true if the provider supports async tile reading.
 
virtual const QgsVectorTileMatrixSettileMatrixSet () const =0
 Returns the tile matrix set associated with the provider.
 
virtual QList< QNetworkRequest > tileRequests (const QgsTileMatrixSet &tileMatrixSet, const QgsTileXYZ &id, Qgis::RendererUsage usage) const
 Returns a network request for a tile.
 
- Public Member Functions inherited from QgsDataProvider
 QgsDataProvider (const QString &uri=QString(), const QgsDataProvider::ProviderOptions &providerOptions=QgsDataProvider::ProviderOptions(), Qgis::DataProviderReadFlags flags=Qgis::DataProviderReadFlags())
 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 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 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 bool setSubsetString (const QString &subset, bool updateFeatureCount=true)
 Set the subset string used to create a subset of features in the layer.
 
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 QString subsetString () const
 Returns the subset definition string currently in use by the layer and used by the provider to limit the feature set.
 
virtual QString subsetStringDialect () const
 Returns a user-friendly string describing the dialect which is supported for subset strings by the provider.
 
virtual QString subsetStringHelpUrl () const
 Returns a URL pointing to documentation describing the dialect which is supported for subset strings by the provider.
 
virtual bool supportsSubsetString () const
 Returns true if the provider supports setting of subset strings.
 
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 Attributes

static int DATA_COLUMN = QNetworkRequest::User + 1
 Role to set column attribute in the request so it can be retrieved later.
 
static int DATA_ROW = QNetworkRequest::User + 2
 Role to set row attribute in the request so it can be retrieved later.
 
static int DATA_SOURCE_ID = QNetworkRequest::User + 4
 Role to set source ID attribute in the request so it can be retrieved later.
 
static int DATA_ZOOM = QNetworkRequest::User + 3
 Role to set zoom attribute in the request so it can be retrieved later.
 

Protected Attributes

std::shared_ptr< QgsVectorTileDataProviderSharedDatamShared
 Mutable data shared between provider instances.
 
- Protected Attributes inherited from QgsDataProvider
QgsError mError
 Error.
 
Qgis::DataProviderReadFlags mReadFlags
 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

- Public Types inherited from QgsDataProvider
enum  ProviderProperty { EvaluateDefaultValues , CustomData = 3000 }
 Properties are used to pass custom configuration options into data providers. 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.
 
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.
 
- Static Public Member Functions inherited from QgsDataProvider
static QString sublayerSeparator ()
 String sequence used for separating components of sublayers strings.
 
- 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 vector tile layer data providers.

Note
Not available in Python bindings
Since
QGIS 3.22

Definition at line 75 of file qgsvectortiledataprovider.h.

Constructor & Destructor Documentation

◆ QgsVectorTileDataProvider() [1/2]

QgsVectorTileDataProvider::QgsVectorTileDataProvider ( const QString &  uri,
const QgsDataProvider::ProviderOptions providerOptions,
Qgis::DataProviderReadFlags  flags 
)

Constructor for QgsVectorTileDataProvider, with the specified uri.

Definition at line 30 of file qgsvectortiledataprovider.cpp.

◆ QgsVectorTileDataProvider() [2/2]

QgsVectorTileDataProvider::QgsVectorTileDataProvider ( const QgsVectorTileDataProvider other)

Definition at line 38 of file qgsvectortiledataprovider.cpp.

Member Function Documentation

◆ clone()

virtual QgsVectorTileDataProvider * QgsVectorTileDataProvider::clone ( ) const
pure virtual

Returns a clone of the data provider.

◆ extent()

QgsRectangle QgsVectorTileDataProvider::extent ( ) const
overridevirtual

Returns the extent of the layer.

Warning
This may be expensive to calculate for some data providers, as it may involve additional network requests or in some cases, iterating through all the features in a layer. If the provider returns the Qgis::DataProviderFlag::FastExtent2D flag from the flags() method then the call to extent() is guaranteed to ALWAYS be fast and not involve any additional work.

Implements QgsDataProvider.

Definition at line 55 of file qgsvectortiledataprovider.cpp.

◆ operator=()

QgsVectorTileDataProvider & QgsVectorTileDataProvider::operator= ( const QgsVectorTileDataProvider other)
delete

◆ providerCapabilities()

Qgis::VectorTileProviderCapabilities QgsVectorTileDataProvider::providerCapabilities ( ) const
virtual

Returns flags containing the supported capabilities of the data provider.

Since
QGIS 3.32

Definition at line 50 of file qgsvectortiledataprovider.cpp.

◆ providerFlags()

Qgis::VectorTileProviderFlags QgsVectorTileDataProvider::providerFlags ( ) const
virtual

Returns flags reflecting the behavior of the data provider.

Since
QGIS 3.32

Definition at line 45 of file qgsvectortiledataprovider.cpp.

◆ readTile()

virtual QgsVectorTileRawData QgsVectorTileDataProvider::readTile ( const QgsTileMatrixSet tileMatrixSet,
const QgsTileXYZ id,
QgsFeedback feedback = nullptr 
) const
pure virtual

Returns raw tile data for a single tile.

◆ readTiles()

virtual QList< QgsVectorTileRawData > QgsVectorTileDataProvider::readTiles ( const QgsTileMatrixSet tileMatrixSet,
const QVector< QgsTileXYZ > &  tiles,
QgsFeedback feedback = nullptr,
Qgis::RendererUsage  usage = Qgis::RendererUsage::Unknown 
) const
pure virtual

Returns raw tile data for a range of tiles.

◆ renderInPreview()

bool QgsVectorTileDataProvider::renderInPreview ( const QgsDataProvider::PreviewContext context)
overridevirtual

Returns whether the layer must be rendered in preview jobs.

The context argument gives useful information which can be used to determine whether the layer should be rendered or not.

The base implementation returns true if lastRenderingTimeMs <= maxRenderingTimeMs.

Note
not available in Python bindings

Reimplemented from QgsDataProvider.

Definition at line 62 of file qgsvectortiledataprovider.cpp.

◆ sourcePath()

virtual QString QgsVectorTileDataProvider::sourcePath ( ) const
pure virtual

Returns the source path for the data.

◆ sourcePaths()

virtual QgsStringMap QgsVectorTileDataProvider::sourcePaths ( ) const
inlinevirtual

Returns the list of source paths for the data.

Since
QGIS 3.40

Definition at line 125 of file qgsvectortiledataprovider.h.

◆ spriteDefinition()

QVariantMap QgsVectorTileDataProvider::spriteDefinition ( ) const
virtual

Returns the sprite definition for the provider, if available.

See also
spriteImage()
styleDefinition()

Definition at line 100 of file qgsvectortiledataprovider.cpp.

◆ spriteImage()

QImage QgsVectorTileDataProvider::spriteImage ( ) const
virtual

Returns the sprite image for the provider, if available.

See also
spriteDefinition()

Definition at line 107 of file qgsvectortiledataprovider.cpp.

◆ styleDefinition()

QVariantMap QgsVectorTileDataProvider::styleDefinition ( ) const
virtual

Returns the style definition for the provider, if available.

See also
styleUrl()
spriteDefinition()

Definition at line 86 of file qgsvectortiledataprovider.cpp.

◆ styleUrl()

QString QgsVectorTileDataProvider::styleUrl ( ) const
virtual

Returns the URL for the provider style, if available.

If styleDefinition() is empty, then the layer style may be available from this URL.

Definition at line 93 of file qgsvectortiledataprovider.cpp.

◆ supportsAsync()

bool QgsVectorTileDataProvider::supportsAsync ( ) const
virtual

Returns true if the provider supports async tile reading.

The default implementation returns false.

Definition at line 72 of file qgsvectortiledataprovider.cpp.

◆ tileMatrixSet()

virtual const QgsVectorTileMatrixSet & QgsVectorTileDataProvider::tileMatrixSet ( ) const
pure virtual

Returns the tile matrix set associated with the provider.

◆ tileRequests()

QList< QNetworkRequest > QgsVectorTileDataProvider::tileRequests ( const QgsTileMatrixSet tileMatrixSet,
const QgsTileXYZ id,
Qgis::RendererUsage  usage 
) const
virtual

Returns a network request for a tile.

The default implementation returns an invalid request.

Definition at line 79 of file qgsvectortiledataprovider.cpp.

Member Data Documentation

◆ DATA_COLUMN

int QgsVectorTileDataProvider::DATA_COLUMN = QNetworkRequest::User + 1
static

Role to set column attribute in the request so it can be retrieved later.

Definition at line 82 of file qgsvectortiledataprovider.h.

◆ DATA_ROW

int QgsVectorTileDataProvider::DATA_ROW = QNetworkRequest::User + 2
static

Role to set row attribute in the request so it can be retrieved later.

Definition at line 84 of file qgsvectortiledataprovider.h.

◆ DATA_SOURCE_ID

int QgsVectorTileDataProvider::DATA_SOURCE_ID = QNetworkRequest::User + 4
static

Role to set source ID attribute in the request so it can be retrieved later.

Definition at line 88 of file qgsvectortiledataprovider.h.

◆ DATA_ZOOM

int QgsVectorTileDataProvider::DATA_ZOOM = QNetworkRequest::User + 3
static

Role to set zoom attribute in the request so it can be retrieved later.

Definition at line 86 of file qgsvectortiledataprovider.h.

◆ mShared

std::shared_ptr<QgsVectorTileDataProviderSharedData> QgsVectorTileDataProvider::mShared
protected

Mutable data shared between provider instances.

Definition at line 198 of file qgsvectortiledataprovider.h.


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