mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-26 00:02:08 -05:00
[BUGFIX][Server] DescribeFeature does not clean attribute name and GetFeature update
This commit is contained in:
parent
16ba918bc8
commit
9b7ef06aa2
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user