Skip to content
Permalink
Browse files

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 ecd8dc4b99d434d0165cbd140fe93e642a346f7d
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/app/browser/qgsinbuiltdataitemproviders.cpp
@@ -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() )
{

0 comments on commit ecd8dc4

Please sign in to comment.