Skip to content

Commit

Permalink
[ogr] Update for GDAL 2 handle 64bit integers in add feature
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jan 7, 2016
1 parent 80c9d02 commit ae2738e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -987,6 +987,13 @@ bool QgsOgrProvider::addFeature( QgsFeature& f )
OGR_F_SetFieldInteger( feature, targetAttributeId, attrVal.toInt() ); OGR_F_SetFieldInteger( feature, targetAttributeId, attrVal.toInt() );
break; break;



#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 2000000
case OFTInteger64:
OGR_F_SetFieldInteger64( feature, targetAttributeId, attrVal.toLongLong() );
break;
#endif

case OFTReal: case OFTReal:
OGR_F_SetFieldDouble( feature, targetAttributeId, attrVal.toDouble() ); OGR_F_SetFieldDouble( feature, targetAttributeId, attrVal.toDouble() );
break; break;
Expand Down Expand Up @@ -1204,6 +1211,11 @@ bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap &attr_
case OFTInteger: case OFTInteger:
OGR_F_SetFieldInteger( of, f, it2->toInt() ); OGR_F_SetFieldInteger( of, f, it2->toInt() );
break; break;
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 2000000
case OFTInteger64:
OGR_F_SetFieldInteger64( of, f, it2->toLongLong() );
break;
#endif
case OFTReal: case OFTReal:
OGR_F_SetFieldDouble( of, f, it2->toDouble() ); OGR_F_SetFieldDouble( of, f, it2->toDouble() );
break; break;
Expand Down

0 comments on commit ae2738e

Please sign in to comment.