Skip to content

Commit

Permalink
QgsVectorFileWriter::initMetaData(): add layer creation options for GPKG
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Apr 23, 2016
1 parent 3ba86d4 commit 6c21b1c
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/core/qgsvectorfilewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 6c21b1c

Please sign in to comment.