Skip to content

Commit 3f31100

Browse files
committed
[BUGFIX][Server] GetFeature: selecting attribute by clean propertyname
1 parent 6aedf02 commit 3f31100

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/server/qgswfsserver.cpp

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

0 commit comments

Comments
 (0)