Skip to content

Commit 6c21b1c

Browse files
committedApr 23, 2016
QgsVectorFileWriter::initMetaData(): add layer creation options for GPKG
1 parent 3ba86d4 commit 6c21b1c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
 

‎src/core/qgsvectorfilewriter.cpp

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,48 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
982982
)
983983
);
984984

985+
// GeoPackage
986+
datasetOptions.clear();
987+
layerOptions.clear();
988+
989+
layerOptions.insert( "IDENTIFIER", new StringOption(
990+
QObject::tr( "Human-readable identifier (e.g. short name) for the layer content" ),
991+
"" // Default value
992+
) );
993+
994+
layerOptions.insert( "DESCRIPTION", new StringOption(
995+
QObject::tr( "Human-readable description for the layer content" ),
996+
"" // Default value
997+
) );
998+
999+
layerOptions.insert( "FID", new StringOption(
1000+
QObject::tr( "Name for the feature identifier column" ),
1001+
"fid" // Default value
1002+
) );
1003+
1004+
layerOptions.insert( "GEOMETRY_NAME", new StringOption(
1005+
QObject::tr( "Name for the geometry column" ),
1006+
"geometry" // Default value
1007+
) );
1008+
1009+
#if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,0,0)
1010+
layerOptions.insert( "SPATIAL_INDEX", new BoolOption(
1011+
QObject::tr( "If a spatial index must be created." ),
1012+
true // Default value
1013+
) );
1014+
#endif
1015+
1016+
driverMetadata.insert( "GPKG",
1017+
MetaData(
1018+
"GeoPackage",
1019+
QObject::tr( "GeoPackage" ),
1020+
"*.gpkg",
1021+
"gpkg",
1022+
datasetOptions,
1023+
layerOptions
1024+
)
1025+
);
1026+
9851027
// Generic Mapping Tools [GMT]
9861028
datasetOptions.clear();
9871029
layerOptions.clear();

0 commit comments

Comments
 (0)
Please sign in to comment.