Skip to content
Permalink
Browse files

[BUGFIX][Server] DescribeFeature does not clean attribute name and Ge…

…tFeature update
  • Loading branch information
rldhont committed Mar 19, 2018
1 parent 16ba918 commit 9b7ef06aa25450da0741f8b06e2f983b6788b5f5
@@ -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" ) );
@@ -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 );

0 comments on commit 9b7ef06

Please sign in to comment.
You can’t perform that action at this time.