mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Support writing LongLong types with GDAL 2
This commit is contained in:
parent
163894d055
commit
5133694e6d
@ -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::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::Double:
|
||||
OGR_F_SetFieldDouble( poFeature, ogrField, attrValue.toDouble() );
|
||||
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(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user