Skip to content
Permalink
Browse files

Expose boolean field creation support for other OGR supported drivers

  • Loading branch information
nyalldawson committed Dec 12, 2017
1 parent f64f41a commit c15ef22ee2b76bd697f9c0b58c725a8c336a7b1c
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/providers/ogr/qgsogrprovider.cpp
@@ -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 );
}

0 comments on commit c15ef22

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