Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[BUGFIX][Server] GetFeature: selecting attribute by clean propertyname
  • Loading branch information
rldhont committed Mar 16, 2018
1 parent 6aedf02 commit 3f31100
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/server/qgswfsserver.cpp
Expand Up @@ -941,11 +941,17 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
QStringList::const_iterator alstIt;
QList<int> idxList;
QgsFields fields = layer->pendingFields();
// build corresponding propertyname
QList<QString> propertynames;
for ( int idx = 0; idx < fields.count(); ++idx )
{
propertynames.append( fields[idx].name().replace( " ", "_" ) );
}
QString fieldName;
for ( alstIt = attrList.begin(); alstIt != attrList.end(); ++alstIt )
{
fieldName = *alstIt;
int fieldNameIdx = fields.fieldNameIndex( fieldName );
int fieldNameIdx = propertynames.indexOf( fieldName );
if ( fieldNameIdx > -1 )
{
idxList.append( fieldNameIdx );
Expand Down

0 comments on commit 3f31100

Please sign in to comment.