Skip to content
Permalink
Browse files

QgsVectorFileWriter::initMetaData(): add layer creation options for GPKG

  • Loading branch information
rouault committed Apr 23, 2016
1 parent 3ba86d4 commit 6c21b1c97c4cf7602c3e4bd2e4475fba558157cc
Showing with 42 additions and 0 deletions.
  1. +42 −0 src/core/qgsvectorfilewriter.cpp
@@ -982,6 +982,48 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
)
);

// GeoPackage
datasetOptions.clear();
layerOptions.clear();

layerOptions.insert( "IDENTIFIER", new StringOption(
QObject::tr( "Human-readable identifier (e.g. short name) for the layer content" ),
"" // Default value
) );

layerOptions.insert( "DESCRIPTION", new StringOption(
QObject::tr( "Human-readable description for the layer content" ),
"" // Default value
) );

layerOptions.insert( "FID", new StringOption(
QObject::tr( "Name for the feature identifier column" ),
"fid" // Default value
) );

layerOptions.insert( "GEOMETRY_NAME", new StringOption(
QObject::tr( "Name for the geometry column" ),
"geometry" // Default value
) );

#if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,0,0)
layerOptions.insert( "SPATIAL_INDEX", new BoolOption(
QObject::tr( "If a spatial index must be created." ),
true // Default value
) );
#endif

driverMetadata.insert( "GPKG",
MetaData(
"GeoPackage",
QObject::tr( "GeoPackage" ),
"*.gpkg",
"gpkg",
datasetOptions,
layerOptions
)
);

// Generic Mapping Tools [GMT]
datasetOptions.clear();
layerOptions.clear();

0 comments on commit 6c21b1c

Please sign in to comment.
You can’t perform that action at this time.