mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-09 00:08:52 -04:00
More efficient cloning of vector tile data providers
This commit is contained in:
parent
fb8702c039
commit
c30bf7eda3
@ -61,6 +61,16 @@ QgsArcGisVectorTileServiceDataProvider::QgsArcGisVectorTileServiceDataProvider(
|
||||
mLayerMetadata.addLink( QgsAbstractMetadataBase::Link( tr( "Source" ), QStringLiteral( "WWW:LINK" ), mArcgisLayerConfiguration.value( QStringLiteral( "serviceUri" ) ).toString() ) );
|
||||
}
|
||||
|
||||
QgsArcGisVectorTileServiceDataProvider::QgsArcGisVectorTileServiceDataProvider( const QgsArcGisVectorTileServiceDataProvider &other )
|
||||
: QgsXyzVectorTileDataProvider( other )
|
||||
{
|
||||
mSourcePath = other.mSourcePath;
|
||||
mArcgisLayerConfiguration = other.mArcgisLayerConfiguration;
|
||||
mArcgisStyleConfiguration = other.mArcgisStyleConfiguration;
|
||||
mCrs = other.mCrs;
|
||||
mLayerMetadata = other.mLayerMetadata;
|
||||
}
|
||||
|
||||
QgsVectorTileDataProvider::ProviderCapabilities QgsArcGisVectorTileServiceDataProvider::providerCapabilities() const
|
||||
{
|
||||
return QgsVectorTileDataProvider::ProviderCapability::ReadLayerMetadata;
|
||||
@ -84,9 +94,7 @@ QgsVectorTileDataProvider *QgsArcGisVectorTileServiceDataProvider::clone() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
ProviderOptions options;
|
||||
options.transformContext = transformContext();
|
||||
return new QgsArcGisVectorTileServiceDataProvider( dataSourceUri(), options, mReadFlags );
|
||||
return new QgsArcGisVectorTileServiceDataProvider( *this );
|
||||
}
|
||||
|
||||
QString QgsArcGisVectorTileServiceDataProvider::sourcePath() const
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
#include "qgis_core.h"
|
||||
#include "qgis_sip.h"
|
||||
#include "qgsvectortilematrixset.h"
|
||||
#include "qgsxyzvectortiledataprovider.h"
|
||||
#include "qgsprovidermetadata.h"
|
||||
|
||||
@ -35,6 +34,8 @@ class CORE_EXPORT QgsArcGisVectorTileServiceDataProvider : public QgsXyzVectorTi
|
||||
const QgsDataProvider::ProviderOptions &providerOptions,
|
||||
QgsDataProvider::ReadFlags flags );
|
||||
|
||||
QgsArcGisVectorTileServiceDataProvider( const QgsArcGisVectorTileServiceDataProvider &other );
|
||||
|
||||
QgsVectorTileDataProvider::ProviderCapabilities providerCapabilities() const override;
|
||||
QString name() const override;
|
||||
QString description() const override;
|
||||
@ -43,7 +44,7 @@ class CORE_EXPORT QgsArcGisVectorTileServiceDataProvider : public QgsXyzVectorTi
|
||||
QgsCoordinateReferenceSystem crs() const override;
|
||||
QgsLayerMetadata layerMetadata() const override;
|
||||
QVariantMap styleDefinition() const override;
|
||||
QString styleUrl() const;
|
||||
QString styleUrl() const override;
|
||||
|
||||
static QString ARCGIS_VT_SERVICE_DATA_PROVIDER_KEY;
|
||||
static QString ARCGIS_VT_SERVICE_DATA_PROVIDER_DESCRIPTION;
|
||||
|
@ -81,6 +81,14 @@ QgsMbTilesVectorTileDataProvider::QgsMbTilesVectorTileDataProvider( const QStrin
|
||||
mIsValid = true;
|
||||
}
|
||||
|
||||
QgsMbTilesVectorTileDataProvider::QgsMbTilesVectorTileDataProvider( const QgsMbTilesVectorTileDataProvider &other )
|
||||
: QgsVectorTileDataProvider( other )
|
||||
{
|
||||
mIsValid = other.mIsValid;
|
||||
mExtent = other.mExtent;
|
||||
mMatrixSet = other.mMatrixSet;
|
||||
}
|
||||
|
||||
QString QgsMbTilesVectorTileDataProvider::name() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
@ -98,10 +106,7 @@ QString QgsMbTilesVectorTileDataProvider::description() const
|
||||
QgsVectorTileDataProvider *QgsMbTilesVectorTileDataProvider::clone() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
ProviderOptions options;
|
||||
options.transformContext = transformContext();
|
||||
return new QgsMbTilesVectorTileDataProvider( dataSourceUri(), options, mReadFlags );
|
||||
return new QgsMbTilesVectorTileDataProvider( *this );
|
||||
}
|
||||
|
||||
QString QgsMbTilesVectorTileDataProvider::sourcePath() const
|
||||
|
@ -37,6 +37,8 @@ class CORE_EXPORT QgsMbTilesVectorTileDataProvider : public QgsVectorTileDataPro
|
||||
const QgsDataProvider::ProviderOptions &providerOptions,
|
||||
QgsDataProvider::ReadFlags flags );
|
||||
|
||||
QgsMbTilesVectorTileDataProvider( const QgsMbTilesVectorTileDataProvider &other );
|
||||
|
||||
QString name() const override;
|
||||
QString description() const override;
|
||||
QgsVectorTileDataProvider *clone() const override;
|
||||
|
@ -26,6 +26,12 @@ QgsVectorTileDataProvider::QgsVectorTileDataProvider(
|
||||
: QgsDataProvider( uri, options, flags )
|
||||
{}
|
||||
|
||||
QgsVectorTileDataProvider::QgsVectorTileDataProvider( const QgsVectorTileDataProvider &other )
|
||||
: QgsDataProvider( other.dataSourceUri( false ), ProviderOptions(), other.mReadFlags )
|
||||
{
|
||||
setTransformContext( other.transformContext() );
|
||||
}
|
||||
|
||||
QgsVectorTileDataProvider::ProviderCapabilities QgsVectorTileDataProvider::providerCapabilities() const
|
||||
{
|
||||
return QgsVectorTileDataProvider::ProviderCapabilities();
|
||||
|
@ -61,6 +61,8 @@ class CORE_EXPORT QgsVectorTileDataProvider : public QgsDataProvider
|
||||
const QgsDataProvider::ProviderOptions &providerOptions,
|
||||
QgsDataProvider::ReadFlags flags );
|
||||
|
||||
QgsVectorTileDataProvider( const QgsVectorTileDataProvider &other );
|
||||
|
||||
/**
|
||||
* Returns flags containing the supported capabilities of the data provider.
|
||||
* \since QGIS 3.32
|
||||
|
@ -67,6 +67,19 @@ QgsVtpkVectorTileDataProvider::QgsVtpkVectorTileDataProvider( const QString &uri
|
||||
mIsValid = true;
|
||||
}
|
||||
|
||||
QgsVtpkVectorTileDataProvider::QgsVtpkVectorTileDataProvider( const QgsVtpkVectorTileDataProvider &other )
|
||||
: QgsVectorTileDataProvider( other )
|
||||
{
|
||||
mIsValid = other.mIsValid;
|
||||
mCrs = other.mCrs;;
|
||||
mExtent = other.mExtent;
|
||||
mMatrixSet = other.mMatrixSet;
|
||||
mLayerMetadata = other.mLayerMetadata;
|
||||
mStyleDefinition = other.mStyleDefinition;
|
||||
mSpriteDefinition = other.mSpriteDefinition;
|
||||
mSpriteImage = other.mSpriteImage;
|
||||
}
|
||||
|
||||
QgsVectorTileDataProvider::ProviderCapabilities QgsVtpkVectorTileDataProvider::providerCapabilities() const
|
||||
{
|
||||
return QgsVectorTileDataProvider::ProviderCapability::ReadLayerMetadata;
|
||||
@ -89,10 +102,7 @@ QString QgsVtpkVectorTileDataProvider::description() const
|
||||
QgsVectorTileDataProvider *QgsVtpkVectorTileDataProvider::clone() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
ProviderOptions options;
|
||||
options.transformContext = transformContext();
|
||||
return new QgsVtpkVectorTileDataProvider( dataSourceUri(), options, mReadFlags );
|
||||
return new QgsVtpkVectorTileDataProvider( *this );
|
||||
}
|
||||
|
||||
QString QgsVtpkVectorTileDataProvider::sourcePath() const
|
||||
|
@ -38,6 +38,7 @@ class CORE_EXPORT QgsVtpkVectorTileDataProvider : public QgsVectorTileDataProvid
|
||||
QgsVtpkVectorTileDataProvider( const QString &uri,
|
||||
const QgsDataProvider::ProviderOptions &providerOptions,
|
||||
QgsDataProvider::ReadFlags flags );
|
||||
QgsVtpkVectorTileDataProvider( const QgsVtpkVectorTileDataProvider &other );
|
||||
|
||||
QgsVectorTileDataProvider::ProviderCapabilities providerCapabilities() const override;
|
||||
QString name() const override;
|
||||
|
@ -63,6 +63,16 @@ QgsXyzVectorTileDataProvider::QgsXyzVectorTileDataProvider( const QString &uri,
|
||||
mIsValid = true;
|
||||
}
|
||||
|
||||
QgsXyzVectorTileDataProvider::QgsXyzVectorTileDataProvider( const QgsXyzVectorTileDataProvider &other )
|
||||
: QgsVectorTileDataProvider( other )
|
||||
{
|
||||
mAuthCfg = other.mAuthCfg;
|
||||
mHeaders = other.mHeaders;
|
||||
mIsValid = other.mIsValid;
|
||||
mExtent = other.mExtent;
|
||||
mMatrixSet = other.mMatrixSet;
|
||||
}
|
||||
|
||||
QString QgsXyzVectorTileDataProvider::name() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
@ -81,9 +91,7 @@ QgsVectorTileDataProvider *QgsXyzVectorTileDataProvider::clone() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
ProviderOptions options;
|
||||
options.transformContext = transformContext();
|
||||
return new QgsXyzVectorTileDataProvider( dataSourceUri(), options, mReadFlags );
|
||||
return new QgsXyzVectorTileDataProvider( *this );
|
||||
}
|
||||
|
||||
QString QgsXyzVectorTileDataProvider::sourcePath() const
|
||||
|
@ -33,6 +33,7 @@ class CORE_EXPORT QgsXyzVectorTileDataProvider : public QgsVectorTileDataProvide
|
||||
QgsXyzVectorTileDataProvider( const QString &uri,
|
||||
const QgsDataProvider::ProviderOptions &providerOptions,
|
||||
QgsDataProvider::ReadFlags flags );
|
||||
QgsXyzVectorTileDataProvider( const QgsXyzVectorTileDataProvider &other );
|
||||
|
||||
QString name() const override;
|
||||
QString description() const override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user