Skip to content
Permalink
Browse files

Support writing LongLong types with GDAL 2

  • Loading branch information
m-kuhn committed Feb 4, 2016
1 parent 163894d commit 5133694e6df9c77e07b0bf4a6b241060f08b03a5
Showing with 17 additions and 3 deletions.
  1. +17 −3 src/core/qgsvectorfilewriter.cpp
@@ -1757,18 +1757,32 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature )

switch ( attrValue.type() )
{
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 2000000
case QVariant::Int:
case QVariant::UInt:
OGR_F_SetFieldInteger( poFeature, ogrField, attrValue.toInt() );
break;
case QVariant::Double:
OGR_F_SetFieldDouble( poFeature, ogrField, attrValue.toDouble() );
case QVariant::LongLong:
case QVariant::ULongLong:
OGR_F_SetFieldInteger64( poFeature, ogrField, attrValue.toLongLong() );
break;
case QVariant::String:
OGR_F_SetFieldString( poFeature, ogrField, mCodec->fromUnicode( attrValue.toString() ).data() );
break;
#else
case QVariant::Int:
OGR_F_SetFieldInteger( poFeature, ogrField, attrValue.toInt() );
break;
case QVariant::String:
case QVariant::LongLong:
case QVariant::UInt:
case QVariant::ULongLong:
case QVariant::String:
OGR_F_SetFieldString( poFeature, ogrField, mCodec->fromUnicode( attrValue.toString() ).data() );
break;
#endif
case QVariant::Double:
OGR_F_SetFieldDouble( poFeature, ogrField, attrValue.toDouble() );
break;
case QVariant::Date:
OGR_F_SetFieldDateTime( poFeature, ogrField,
attrValue.toDate().year(),

0 comments on commit 5133694

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