Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Prevent spatialindex creation by default on GPKG
Fixes #41436

Manual Backport from master 62bb273
  • Loading branch information
elpaso authored and nyalldawson committed Feb 19, 2021
1 parent bbe476a commit ecd8dc4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/browser/qgsinbuiltdataitemproviders.cpp
Expand Up @@ -923,7 +923,10 @@ void QgsDatabaseItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *
geometryType != QgsWkbTypes::Unknown };
const QgsCoordinateReferenceSystem crs { dlg.crs( ) };
// This flag tells to the provider that field types do not need conversion
QMap<QString, QVariant> options { { QStringLiteral( "skipConvertFields" ), true } };
// also prevents GDAL to create a spatial index by default for GPKG, we are
// going to create it afterwards in a unified manner for all providers.
QMap<QString, QVariant> options { { QStringLiteral( "skipConvertFields" ), true },
{ QStringLiteral( "layerOptions" ), QStringLiteral( "SPATIAL_INDEX=NO" ) } };

if ( ! geometryColumn.isEmpty() )
{
Expand Down

0 comments on commit ecd8dc4

Please sign in to comment.