Skip to content

Commit

Permalink
GDAL 2.0 allows writing 64bit longlong integers
Browse files Browse the repository at this point in the history
Fix #14411
  • Loading branch information
m-kuhn committed Mar 15, 2016
1 parent 4089ed8 commit 7de0757
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/qgsvectorfilewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,19 @@ void QgsVectorFileWriter::init( QString vectorFileName, QString fileEncoding, co

switch ( attrField.type() )
{
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM < 2000000
case QVariant::LongLong:
ogrType = OFTString;
ogrWidth = ogrWidth > 0 && ogrWidth <= 21 ? ogrWidth : 21;
ogrPrecision = -1;
break;

#else
case QVariant::LongLong:
ogrType = OFTInteger64;
ogrWidth = ogrWidth > 0 && ogrWidth <= 20 ? ogrWidth : 20;
ogrPrecision = 0;
break;
#endif
case QVariant::String:
ogrType = OFTString;
if ( ogrWidth <= 0 || ogrWidth > 255 )
Expand Down

0 comments on commit 7de0757

Please sign in to comment.