Skip to content

Commit

Permalink
[afs] Correctly convert attribute values to field type
Browse files Browse the repository at this point in the history
Avoids AFS provider returning double values for integer
and long field types
  • Loading branch information
nyalldawson committed Feb 20, 2018
1 parent d87738b commit 8b0b826
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/providers/arcgisrest/qgsafsshareddata.cpp
Expand Up @@ -90,7 +90,9 @@ bool QgsAfsSharedData::getFeature( QgsFeatureId id, QgsFeature &f, bool fetchGeo
QgsAttributes attributes( mFields.size() );
foreach ( int idx, fetchAttribIdx )
{
attributes[idx] = attributesData[mFields.at( idx ).name()];
QVariant attribute = attributesData[mFields.at( idx ).name()];
mFields.at( idx ).convertCompatible( attribute );
attributes[idx] = attribute;
if ( mFields.at( idx ).name() == QStringLiteral( "OBJECTID" ) )
{
featureId = startId + objectIds.indexOf( attributesData[mFields.at( idx ).name()].toInt() );
Expand Down

0 comments on commit 8b0b826

Please sign in to comment.