Skip to content

Commit 8b0b826

Browse files
committed
[afs] Correctly convert attribute values to field type
Avoids AFS provider returning double values for integer and long field types
1 parent d87738b commit 8b0b826

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/providers/arcgisrest/qgsafsshareddata.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ bool QgsAfsSharedData::getFeature( QgsFeatureId id, QgsFeature &f, bool fetchGeo
9090
QgsAttributes attributes( mFields.size() );
9191
foreach ( int idx, fetchAttribIdx )
9292
{
93-
attributes[idx] = attributesData[mFields.at( idx ).name()];
93+
QVariant attribute = attributesData[mFields.at( idx ).name()];
94+
mFields.at( idx ).convertCompatible( attribute );
95+
attributes[idx] = attribute;
9496
if ( mFields.at( idx ).name() == QStringLiteral( "OBJECTID" ) )
9597
{
9698
featureId = startId + objectIds.indexOf( attributesData[mFields.at( idx ).name()].toInt() );

0 commit comments

Comments
 (0)