QGIS API Documentation 3.28.14-Firenze (exported)
Loading...
Searching...
No Matches
qgsfilebaseddataitemprovider.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsfilebaseddataitemprovider.cpp
3 --------------------------------------
4 Date : July 2021
5 Copyright : (C) 2021 by Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
17#include "qgsdataprovider.h"
18#include "qgsproviderregistry.h"
19#include "qgslogger.h"
20#include "qgssettings.h"
21#include "qgsogrproviderutils.h"
22#include "qgsstyle.h"
23#include "qgsgeopackagedataitems.h"
25#include "qgsfieldsitem.h"
26#include "qgsfielddomainsitem.h"
28#include "qgsproviderutils.h"
29#include "qgsmbtiles.h"
31#include "qgsprovidermetadata.h"
32#include <QUrlQuery>
33
34//
35// QgsProviderSublayerItem
36//
37
39 const QgsProviderSublayerDetails &details, const QString &filePath )
40 : QgsLayerItem( parent, name, filePath.isEmpty() ? details.uri() : filePath, details.uri(), layerTypeFromSublayer( details ), details.providerKey() )
41 , mDetails( details )
42{
43 mToolTip = details.uri();
44
45 // no children, except for vector layers, which will show the fields item
47}
48
50{
51 QVector<QgsDataItem *> children;
52
53 if ( mDetails.type() == QgsMapLayerType::VectorLayer )
54 {
55 // sqlite gets special handling because it delegates to the dedicated spatialite provider
56 if ( mDetails.driverName() == QLatin1String( "SQLite" ) )
57 {
58 children.push_back( new QgsFieldsItem( this,
59 path() + QStringLiteral( "/columns/ " ),
60 QStringLiteral( R"(dbname="%1")" ).arg( parent()->path().replace( '"', QLatin1String( R"(\")" ) ) ),
61 QStringLiteral( "spatialite" ), QString(), name() ) );
62 }
63 else if ( mDetails.providerKey() == QLatin1String( "ogr" ) )
64 {
65 // otherwise we use the default OGR database connection approach, which is the generic way to handle this
66 // for all OGR layer types
67 children.push_back( new QgsFieldsItem( this,
68 path() + QStringLiteral( "/columns/ " ),
69 path(),
70 QStringLiteral( "ogr" ), QString(), name() ) );
71
72 std::unique_ptr<QgsAbstractDatabaseProviderConnection> conn( databaseConnection() );
74 {
75 QString relationError;
76 QList< QgsWeakRelation > relations;
77 try
78 {
79 relations = conn->relationships( QString(), mDetails.name() );
80 }
82 {
83 relationError = ex.what();
84 }
85
86 if ( !relations.empty() || !relationError.isEmpty() )
87 {
88 std::unique_ptr< QgsRelationshipsItem > relationsItem = std::make_unique< QgsRelationshipsItem >( this, mPath + "/relations", conn->uri(), QStringLiteral( "ogr" ), QString(), mDetails.name() );
89 // force this item to appear last by setting a maximum string value for the sort key
90 relationsItem->setSortKey( QString( QChar( 0x11FFFF ) ) );
91 children.append( relationsItem.release() );
92 }
93 }
94 }
95 }
96 return children;
97}
98
103
105{
106 if ( parent() )
107 {
109 return connection;
110 }
111
112 if ( mDetails.providerKey() == QLatin1String( "ogr" ) )
113 {
114 if ( QgsProviderMetadata *md = QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "ogr" ) ) )
115 {
116 QVariantMap parts;
117 parts.insert( QStringLiteral( "path" ), path() );
118 return static_cast<QgsAbstractDatabaseProviderConnection *>( md->createConnection( md->encodeUri( parts ), {} ) );
119 }
120 }
121
122 return nullptr;
123}
124
125Qgis::BrowserLayerType QgsProviderSublayerItem::layerTypeFromSublayer( const QgsProviderSublayerDetails &sublayer )
126{
127 switch ( sublayer.type() )
128 {
130 {
131 switch ( QgsWkbTypes::geometryType( sublayer.wkbType() ) )
132 {
135
138
141
144
147 }
148
149 break;
150 }
153
156
159
162
165
168 break;
169 }
171}
172
174{
175 return mDetails.name();
176}
177
178//
179// QgsFileDataCollectionGroupItem
180//
181QgsFileDataCollectionGroupItem::QgsFileDataCollectionGroupItem( QgsDataItem *parent, const QString &groupName, const QString &path )
182 : QgsDataCollectionItem( parent, groupName, path )
183{
185 mIconName = QStringLiteral( "mIconDbSchema.svg" );
186}
187
189{
190 mSublayers.append( sublayer );
191}
192
194{
195 return true;
196}
197
199{
201 res.reserve( mSublayers.size() );
202
203 for ( const QgsProviderSublayerDetails &sublayer : mSublayers )
204 {
205 res << sublayer.toMimeUri();
206 }
207 return res;
208}
209
210//
211// QgsFileDataCollectionItem
212//
213
214QgsFileDataCollectionItem::QgsFileDataCollectionItem( QgsDataItem *parent, const QString &name, const QString &path, const QList<QgsProviderSublayerDetails> &sublayers )
215 : QgsDataCollectionItem( parent, name, path )
216 , mSublayers( sublayers )
217{
220 else
222
223 if ( !qgsVsiPrefix( path ).isEmpty() )
224 {
225 mIconName = QStringLiteral( "/mIconZip.svg" );
226 }
227}
228
230{
231 QList< QgsProviderSublayerDetails> sublayers;
233 || mSublayers.empty() )
234 {
236 }
237 else
238 {
239 sublayers = mSublayers;
240 }
241 // only ever use the initial sublayers for first population -- after that we requery when asked to create children,
242 // or the item won't "refresh" and update its sublayers when the actual file changes
243 mSublayers.clear();
244 // remove the fast flag -- after the first population we need to requery the dataset
246
247 QVector<QgsDataItem *> children;
248 children.reserve( sublayers.size() );
249 QMap< QStringList, QgsFileDataCollectionGroupItem * > groupItems;
250 for ( const QgsProviderSublayerDetails &sublayer : std::as_const( sublayers ) )
251 {
252 QgsProviderSublayerItem *item = new QgsProviderSublayerItem( nullptr, sublayer.name(), sublayer, QString() );
253
254 if ( !sublayer.path().isEmpty() )
255 {
256 QStringList currentPath;
257 QStringList remainingPaths = sublayer.path();
258 QgsFileDataCollectionGroupItem *groupItem = nullptr;
259
260 while ( !remainingPaths.empty() )
261 {
262 currentPath << remainingPaths.takeAt( 0 );
263
264 auto it = groupItems.constFind( currentPath );
265 if ( it == groupItems.constEnd() )
266 {
267 QgsFileDataCollectionGroupItem *newGroupItem = new QgsFileDataCollectionGroupItem( this, currentPath.constLast(), path() + '/' + currentPath.join( ',' ) );
269 groupItems.insert( currentPath, newGroupItem );
270 if ( groupItem )
271 groupItem->addChildItem( newGroupItem );
272 else
273 children.append( newGroupItem );
274 groupItem = newGroupItem;
275 }
276 else
277 {
278 groupItem = it.value();
279 }
280
281 if ( groupItem )
282 groupItem->appendSublayer( sublayer );
283 }
284
285 if ( groupItem )
286 groupItem->addChildItem( item );
287 }
288 else
289 {
290 children.append( item );
291 }
292 }
293
294 std::unique_ptr<QgsAbstractDatabaseProviderConnection> conn( databaseConnection() );
295 if ( conn )
296 {
297 mCachedCapabilities = conn->capabilities();
298 mHasCachedCapabilities = true;
299 }
300 if ( conn && ( mCachedCapabilities & QgsAbstractDatabaseProviderConnection::Capability::ListFieldDomains ) )
301 {
302 QString domainError;
303 QStringList fieldDomains;
304 try
305 {
306 fieldDomains = conn->fieldDomainNames();
307 }
309 {
310 domainError = ex.what();
311 }
312
313 if ( !fieldDomains.empty() || !domainError.isEmpty() )
314 {
315 std::unique_ptr< QgsFieldDomainsItem > domainsItem = std::make_unique< QgsFieldDomainsItem >( this, mPath + "/domains", conn->uri(), QStringLiteral( "ogr" ) );
316 // force this item to appear last by setting a maximum string value for the sort key
317 domainsItem->setSortKey( QString( QChar( 0x10FFFF ) ) );
318 children.append( domainsItem.release() );
319 }
320 }
322 {
323 QString relationError;
324 QList< QgsWeakRelation > relations;
325 try
326 {
327 relations = conn->relationships();
328 }
330 {
331 relationError = ex.what();
332 }
333
334 if ( !relations.empty() || !relationError.isEmpty() )
335 {
336 std::unique_ptr< QgsRelationshipsItem > relationsItem = std::make_unique< QgsRelationshipsItem >( this, mPath + "/relations", conn->uri(), QStringLiteral( "ogr" ) );
337 // force this item to appear last by setting a maximum string value for the sort key
338 relationsItem->setSortKey( QString( QChar( 0x11FFFF ) ) );
339 children.append( relationsItem.release() );
340 }
341 }
342
343 return children;
344}
345
347{
348 return true;
349}
350
352{
353 QgsMimeDataUtils::Uri collectionUri;
354 collectionUri.uri = path();
355 collectionUri.layerType = QStringLiteral( "collection" );
356 collectionUri.filePath = path();
357 return { collectionUri };
358}
359
361{
362 // test that file is valid with OGR
363 if ( OGRGetDriverCount() == 0 )
364 {
365 OGRRegisterAll();
366 }
367 // do not print errors, but write to debug
368 CPLPushErrorHandler( CPLQuietErrorHandler );
369 CPLErrorReset();
370 GDALDriverH hDriver = GDALIdentifyDriverEx( path().toUtf8().constData(), GDAL_OF_VECTOR, nullptr, nullptr );
371 CPLPopErrorHandler();
372
373 if ( ! hDriver )
374 {
375 QgsDebugMsgLevel( QStringLiteral( "GDALIdentifyDriverEx error # %1 : %2 on %3" ).arg( CPLGetLastErrorNo() ).arg( CPLGetLastErrorMsg() ).arg( path() ), 2 );
376 return nullptr;
377 }
378
379 const QString driverName = GDALGetDriverShortName( hDriver );
380 if ( driverName == QLatin1String( "PDF" )
381 || driverName == QLatin1String( "DXF" ) )
382 {
383 // unwanted drivers -- it's slow to create connections for these, and we don't really want
384 // to expose database capabilities for them (even though they kind of are database formats)
385 return nullptr;
386 }
387
389 if ( driverName == QLatin1String( "SQLite" ) )
390 {
391 // sqlite gets special handling, as we delegate to the native spatialite provider
392 if ( QgsProviderMetadata *md = QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "spatialite" ) ) )
393 {
395 uri.setDatabase( path( ) );
396 conn = static_cast<QgsAbstractDatabaseProviderConnection *>( md->createConnection( uri.uri(), {} ) );
397 }
398 }
399 else
400 {
401 // for all other vector types we use the generic OGR provider
402 if ( QgsProviderMetadata *md = QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "ogr" ) ) )
403 {
404 QVariantMap parts;
405 parts.insert( QStringLiteral( "path" ), path() );
406 conn = static_cast<QgsAbstractDatabaseProviderConnection *>( md->createConnection( md->encodeUri( parts ), {} ) );
407 }
408 }
409 return conn;
410}
411
412QgsAbstractDatabaseProviderConnection::Capabilities QgsFileDataCollectionItem::databaseConnectionCapabilities() const
413{
414 if ( mHasCachedCapabilities )
415 return mCachedCapabilities;
416
417 std::unique_ptr<QgsAbstractDatabaseProviderConnection> conn( databaseConnection() );
418 if ( conn )
419 {
420 mCachedCapabilities = conn->capabilities();
421 mHasCachedCapabilities = true;
422 }
423 return mCachedCapabilities;
424}
425
426//
427// QgsFileBasedDataItemProvider
428//
429
431{
432 return QStringLiteral( "files" );
433}
434
439
441{
442 if ( path.isEmpty() )
443 return nullptr;
444
445 const QFileInfo info( path );
446 QString suffix = info.suffix().toLower();
447 const QString name = info.fileName();
448
449 // special handling for some suffixes
450 if ( suffix.compare( QLatin1String( "gpkg" ), Qt::CaseInsensitive ) == 0 )
451 {
452 // Geopackage is special -- it gets a dedicated collection item type
453 QgsGeoPackageCollectionItem *item = new QgsGeoPackageCollectionItem( parentItem, name, path );
454 item->setCapabilities( item->capabilities2() | Qgis::BrowserItemCapability::ItemRepresentsFile );
455 return item;
456 }
457 else if ( suffix == QLatin1String( "txt" ) )
458 {
459 // never ever show .txt files as datasets in browser -- they are only used for geospatial data in extremely rare cases
460 // and are predominantly just noise in the browser
461 return nullptr;
462 }
463 // If a .tab exists, then the corresponding .map/.dat is very likely a
464 // side-car file of the .tab
465 else if ( suffix == QLatin1String( "map" ) || suffix == QLatin1String( "dat" ) )
466 {
467 if ( QFile::exists( QDir( info.path() ).filePath( info.baseName() + ".tab" ) ) || QFile::exists( QDir( info.path() ).filePath( info.baseName() + ".TAB" ) ) )
468 return nullptr;
469 }
470 // .dbf and .shx should only appear if .shp is not present
471 else if ( suffix == QLatin1String( "dbf" ) || suffix == QLatin1String( "shx" ) )
472 {
473 if ( QFile::exists( QDir( info.path() ).filePath( info.baseName() + ".shp" ) ) || QFile::exists( QDir( info.path() ).filePath( info.baseName() + ".SHP" ) ) )
474 return nullptr;
475 }
476 // skip QGIS style xml files
477 else if ( suffix == QLatin1String( "xml" ) && QgsStyle::isXmlStyleFile( path ) )
478 {
479 return nullptr;
480 }
481 // GDAL 3.1 Shapefile driver directly handles .shp.zip files
482 else if ( path.endsWith( QLatin1String( ".shp.zip" ), Qt::CaseInsensitive ) &&
483 GDALIdentifyDriverEx( path.toUtf8().constData(), GDAL_OF_VECTOR, nullptr, nullptr ) )
484 {
485 suffix = QStringLiteral( "shp.zip" );
486 }
487 // special handling for mbtiles files
488 else if ( suffix == QLatin1String( "mbtiles" ) )
489 {
490 QgsMbTiles reader( path );
491 if ( reader.open() )
492 {
493 if ( reader.metadataValue( QStringLiteral( "format" ) ) == QLatin1String( "pbf" ) )
494 {
495 // these are vector tiles
496 QUrlQuery uq;
497 uq.addQueryItem( QStringLiteral( "type" ), QStringLiteral( "mbtiles" ) );
498 uq.addQueryItem( QStringLiteral( "url" ), path );
499 const QString encodedUri = uq.toString();
500 QgsVectorTileLayerItem *item = new QgsVectorTileLayerItem( parentItem, name, path, encodedUri );
501 item->setCapabilities( item->capabilities2() | Qgis::BrowserItemCapability::ItemRepresentsFile );
502 return item;
503 }
504 else
505 {
506 // handled by WMS provider
507 QUrlQuery uq;
508 uq.addQueryItem( QStringLiteral( "type" ), QStringLiteral( "mbtiles" ) );
509 uq.addQueryItem( QStringLiteral( "url" ), QUrl::fromLocalFile( path ).toString() );
510 const QString encodedUri = uq.toString();
511 QgsLayerItem *item = new QgsLayerItem( parentItem, name, path, encodedUri, Qgis::BrowserLayerType::Raster, QStringLiteral( "wms" ) );
514 return item;
515 }
516 }
517 }
518
519 // hide blocklisted URIs, such as .aux.xml files
520 if ( QgsProviderRegistry::instance()->uriIsBlocklisted( path ) )
521 return nullptr;
522
523 QgsSettings settings;
524
525 Qgis::SublayerQueryFlags queryFlags = Qgis::SublayerQueryFlags();
526
527 // should we fast scan only?
528 if ( ( settings.value( QStringLiteral( "qgis/scanItemsInBrowser2" ),
529 "extension" ).toString() == QLatin1String( "extension" ) ) ||
530 ( parentItem && settings.value( QStringLiteral( "qgis/scanItemsFastScanUris" ),
531 QStringList() ).toStringList().contains( parentItem->path() ) ) )
532 {
534 }
535
536 const QList<QgsProviderSublayerDetails> sublayers = QgsProviderRegistry::instance()->querySublayers( path, queryFlags );
537
538 if ( sublayers.size() == 1
541 )
542 {
543 QgsProviderSublayerItem *item = new QgsProviderSublayerItem( parentItem, name, sublayers.at( 0 ), path );
545 return item;
546 }
547 else if ( !sublayers.empty() )
548 {
549 QgsFileDataCollectionItem *item = new QgsFileDataCollectionItem( parentItem, name, path, sublayers );
551 return item;
552 }
553 else
554 {
555 return nullptr;
556 }
557}
558
560{
561 QFileInfo info( path );
562 QString suffix = info.suffix().toLower();
563
564 QStringList dirExtensions = QgsOgrProviderUtils::directoryExtensions();
565 return dirExtensions.contains( suffix );
566}
@ NotPopulated
Children not yet created.
@ Populated
Children created.
@ Fertile
Can create children. Even items without this capability may have children, but cannot create them,...
@ RefreshChildrenWhenItemIsRefreshed
When the item is refreshed, all its populated children will also be refreshed in turn (since QGIS 3....
@ ItemRepresentsFile
Item's path() directly represents a file on disk (since QGIS 3.22)
@ Fast
CreateChildren() is fast enough to be run in main thread when refreshing items, most root items (wms,...
@ FastScan
Indicates that the provider must scan for sublayers using the fastest possible approach – e....
@ ResolveGeometryType
Attempt to resolve the geometry type for vector sublayers.
BrowserLayerType
Browser item layer types.
Definition qgis.h:403
@ Point
Vector point layer.
@ Plugin
Plugin based layer.
@ Line
Vector line layer.
@ Polygon
Vector polygon layer.
@ Vector
Generic vector layer.
@ VectorTile
Vector tile layer.
@ Raster
Raster layer.
@ TableLayer
Vector non-spatial layer.
@ PointCloud
Point cloud layer.
The QgsAbstractDatabaseProviderConnection class provides common functionality for DB based connection...
@ RetrieveRelationships
Can retrieve relationships from the database (since QGIS 3.28)
@ ListFieldDomains
Can return a list of field domain names via fieldDomainNames() (since QGIS 3.26)
A Collection: logical collection of layers or subcollections, e.g.
Base class for all items in the model.
Definition qgsdataitem.h:46
QString mToolTip
QString mPath
QVector< QgsDataItem * > children() const
Qgis::BrowserItemCapabilities mCapabilities
QString mIconName
QString name() const
Returns the name of the item (the displayed text for the item).
QString path() const
virtual void setState(Qgis::BrowserItemState state)
Set item state.
virtual void setCapabilities(Qgis::BrowserItemCapabilities capabilities)
Sets the capabilities for the data item.
virtual void addChildItem(QgsDataItem *child, bool refresh=false)
Inserts a new child item.
QgsDataItem * parent() const
Gets item parent.
virtual Qgis::BrowserItemCapabilities capabilities2() const
Returns the capabilities for the data item.
Class for storing the component parts of a RDBMS data source URI (e.g.
QString uri(bool expandAuthConfig=true) const
Returns the complete URI as a string.
void setDatabase(const QString &database)
Sets the URI database name.
QString what() const
A collection of field items with some internal logic to retrieve the fields and a the vector layer in...
QString name() override
Human-readable name of the provider name.
int capabilities() const override
Returns combination of flags from QgsDataProvider::DataCapabilities.
bool handlesDirectoryPath(const QString &path) override
Returns true if the provider will handle the directory at the specified path.
QgsDataItem * createDataItem(const QString &path, QgsDataItem *parentItem) override
Create a new instance of QgsDataItem (or nullptr) for given path and parent item.
A data collection item for grouping of the content in file based data collections (e....
QgsFileDataCollectionGroupItem(QgsDataItem *parent, const QString &groupName, const QString &path)
Constructor for QgsFileDataCollectionGroupItem.
void appendSublayer(const QgsProviderSublayerDetails &sublayer)
Adds a sublayer to the group.
QgsMimeDataUtils::UriList mimeUris() const override
Returns mime URIs for the data item, most data providers will only return a single URI but some data ...
bool hasDragEnabled() const override
Returns true if the item may be dragged.
A data collection item for file based data collections (e.g.
bool hasDragEnabled() const override
Returns true if the item may be dragged.
QVector< QgsDataItem * > createChildren() override
Create children.
QgsAbstractDatabaseProviderConnection::Capabilities databaseConnectionCapabilities() const
Returns the associated connection capabilities, if a databaseConnection() is available.
QgsMimeDataUtils::UriList mimeUris() const override
Returns mime URIs for the data item, most data providers will only return a single URI but some data ...
QgsAbstractDatabaseProviderConnection * databaseConnection() const override
For data items that represent a DB connection or one of its children, this method returns a connectio...
QgsFileDataCollectionItem(QgsDataItem *parent, const QString &name, const QString &path, const QList< QgsProviderSublayerDetails > &sublayers)
Constructor for QgsFileDataCollectionItem.
Item that represents a layer that can be opened with one of the providers.
Utility class for reading and writing MBTiles files (which are SQLite3 databases).
Definition qgsmbtiles.h:39
QString metadataValue(const QString &key) const
Requests metadata value for the given key.
bool open()
Tries to open the file, returns true on success.
QList< QgsMimeDataUtils::Uri > UriList
Custom exception class for provider connection related exceptions.
Holds data provider key, description, and associated shared library file or function pointer informat...
QList< QgsProviderSublayerDetails > querySublayers(const QString &uri, Qgis::SublayerQueryFlags flags=Qgis::SublayerQueryFlags(), QgsFeedback *feedback=nullptr) const
Queries the specified uri and returns a list of any valid sublayers found in the dataset which can be...
static QgsProviderRegistry * instance(const QString &pluginPath=QString())
Means of accessing canonical single instance.
QgsProviderMetadata * providerMetadata(const QString &providerKey) const
Returns metadata of the provider or nullptr if not found.
Contains details about a sub layer available from a dataset.
QStringList path() const
Returns the path to the sublayer.
QgsWkbTypes::Type wkbType() const
Returns the layer's WKB type, or QgsWkbTypes::Unknown if the WKB type is not application or unknown.
QString uri() const
Returns the layer's URI.
QgsMapLayerType type() const
Returns the layer type.
QgsMimeDataUtils::Uri toMimeUri() const
Converts the sublayer details to a QgsMimeDataUtils::Uri representing the sublayer.
QString driverName() const
Returns the layer's driver name.
QString providerKey() const
Returns the associated data provider key.
QString name() const
Returns the layer's name.
A generic data item for file based layers.
QgsAbstractDatabaseProviderConnection * databaseConnection() const override
For data items that represent a DB connection or one of its children, this method returns a connectio...
QVector< QgsDataItem * > createChildren() override
Create children.
QgsProviderSublayerItem(QgsDataItem *parent, const QString &name, const QgsProviderSublayerDetails &details, const QString &filePath)
Constructor for QgsProviderSublayerItem.
QgsProviderSublayerDetails sublayerDetails() const
Returns the sublayer details for the item.
static bool sublayerDetailsAreIncomplete(const QList< QgsProviderSublayerDetails > &details, QgsProviderUtils::SublayerCompletenessFlags flags=QgsProviderUtils::SublayerCompletenessFlags())
Returns true if the sublayer details are incomplete, and require a more in-depth scan.
@ IgnoreUnknownGeometryType
Indicates that an unknown geometry type should not be considered as incomplete.
@ IgnoreUnknownFeatureCount
Indicates that an unknown feature count should not be considered as incomplete.
This class is a composition of two QSettings instances:
Definition qgssettings.h:62
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
static bool isXmlStyleFile(const QString &path)
Tests if the file at path is a QGIS style XML file.
static GeometryType geometryType(Type type)
Returns the geometry type for a WKB type, e.g., both MultiPolygon and CurvePolygon would have a Polyg...
@ PointCloudLayer
Point cloud layer. Added in QGIS 3.18.
@ MeshLayer
Mesh layer. Added in QGIS 3.2.
@ VectorLayer
Vector layer.
@ RasterLayer
Raster layer.
@ GroupLayer
Composite group layer. Added in QGIS 3.24.
@ VectorTileLayer
Vector tile layer. Added in QGIS 3.14.
@ AnnotationLayer
Contains freeform, georeferenced annotations. Added in QGIS 3.16.
@ PluginLayer
Plugin based layer.
QString qgsVsiPrefix(const QString &path)
Definition qgis.cpp:192
#define QgsDebugMsgLevel(str, level)
Definition qgslogger.h:39
QString filePath
Path to file, if uri is associated with a file.
QString uri
Identifier of the data source recognized by its providerKey.
QString layerType
Type of URI.