Skip to content

Commit

Permalink
[BUGFIX][Server] DescribeFeature does not clean attribute name and Ge…
Browse files Browse the repository at this point in the history
…tFeature update
  • Loading branch information
rldhont committed Mar 19, 2018
1 parent 16ba918 commit 9b7ef06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/server/services/wfs/qgswfsdescribefeaturetype.cpp
Expand Up @@ -263,7 +263,7 @@ namespace QgsWfs

//xsd:element
QDomElement attElem = doc.createElement( QStringLiteral( "element" )/*xsd:element*/ );
attElem.setAttribute( QStringLiteral( "name" ), attributeName );
attElem.setAttribute( QStringLiteral( "name" ), attributeName.replace( ' ', '_' ) );
QVariant::Type attributeType = fields.at( idx ).type();
if ( attributeType == QVariant::Int )
attElem.setAttribute( QStringLiteral( "type" ), QStringLiteral( "integer" ) );
Expand Down
8 changes: 7 additions & 1 deletion src/server/services/wfs/qgswfsgetfeature.cpp
Expand Up @@ -248,11 +248,17 @@ namespace QgsWfs
QStringList::const_iterator plstIt;
QList<int> idxList;
QgsFields fields = vlayer->fields();
// build corresponding propertyname
QList<QString> propertynames;
for ( int idx = 0; idx < fields.count(); ++idx )
{
propertynames.append( fields.field( idx ).name().replace( ' ', '_' ) );
}
QString fieldName;
for ( plstIt = propertyList.begin(); plstIt != propertyList.end(); ++plstIt )
{
fieldName = *plstIt;
int fieldNameIdx = fields.lookupField( fieldName );
int fieldNameIdx = propertynames.indexOf( fieldName );
if ( fieldNameIdx > -1 )
{
idxList.append( fieldNameIdx );
Expand Down

0 comments on commit 9b7ef06

Please sign in to comment.