Skip to content

Commit

Permalink
Expose boolean field creation support for other OGR supported drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 12, 2017
1 parent f64f41a commit c15ef22
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -466,9 +466,15 @@ QgsOgrProvider::QgsOgrProvider( QString const &uri )
<< QgsVectorDataProvider::NativeType( tr( "Date & Time" ), QStringLiteral( "datetime" ), QVariant::DateTime );
}

if ( mGDALDriverName == QLatin1String( "GPKG" ) )
{
// boolean data type - likely other drivers also support this
if ( mGDALDriverName == QLatin1String( "GeoJSON" ) ||
mGDALDriverName == QLatin1String( "GML" ) ||
mGDALDriverName == QLatin1String( "CSV" ) ||
mGDALDriverName == QLatin1String( "PostgreSQL" ) ||
mGDALDriverName == QLatin1String( "PGDump" ) ||
mGDALDriverName == QLatin1String( "SQLite" ) ||
mGDALDriverName == QLatin1String( "GPKG" ) )
{
// boolean data type
nativeTypes
<< QgsVectorDataProvider::NativeType( tr( "Boolean" ), QStringLiteral( "bool" ), QVariant::Bool, -1, -1, -1, -1 );
}
Expand Down

0 comments on commit c15ef22

Please sign in to comment.