Skip to content

Commit 7de0757

Browse files
committedMar 15, 2016
GDAL 2.0 allows writing 64bit longlong integers
Fix #14411
1 parent 4089ed8 commit 7de0757

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎src/core/qgsvectorfilewriter.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,19 @@ void QgsVectorFileWriter::init( QString vectorFileName, QString fileEncoding, co
362362

363363
switch ( attrField.type() )
364364
{
365+
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM < 2000000
365366
case QVariant::LongLong:
366367
ogrType = OFTString;
367368
ogrWidth = ogrWidth > 0 && ogrWidth <= 21 ? ogrWidth : 21;
368369
ogrPrecision = -1;
369370
break;
370-
371+
#else
372+
case QVariant::LongLong:
373+
ogrType = OFTInteger64;
374+
ogrWidth = ogrWidth > 0 && ogrWidth <= 20 ? ogrWidth : 20;
375+
ogrPrecision = 0;
376+
break;
377+
#endif
371378
case QVariant::String:
372379
ogrType = OFTString;
373380
if ( ogrWidth <= 0 || ogrWidth > 255 )

0 commit comments

Comments
 (0)
Please sign in to comment.