Skip to content

Commit 153835e

Browse files
committed
[BUGFIX][Server] GetFeature: selecting attribute by clean propertyname
1 parent 8b37bab commit 153835e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/server/qgswfsserver.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,11 +940,17 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
940940
QStringList::const_iterator alstIt;
941941
QList<int> idxList;
942942
QgsFields fields = layer->pendingFields();
943+
// build corresponding propertyname
944+
QList<QString> propertynames;
945+
for ( int idx = 0; idx < fields.count(); ++idx )
946+
{
947+
propertynames.append( fields[idx].name().replace( " ", "_" ) );
948+
}
943949
QString fieldName;
944950
for ( alstIt = attrList.begin(); alstIt != attrList.end(); ++alstIt )
945951
{
946952
fieldName = *alstIt;
947-
int fieldNameIdx = fields.fieldNameIndex( fieldName );
953+
int fieldNameIdx = propertynames.indexOf( fieldName );
948954
if ( fieldNameIdx > -1 )
949955
{
950956
idxList.append( fieldNameIdx );

0 commit comments

Comments
 (0)