mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -04: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
|
//xsd:element
|
||||||
QDomElement attElem = doc.createElement( QStringLiteral( "element" )/*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();
|
QVariant::Type attributeType = fields.at( idx ).type();
|
||||||
if ( attributeType == QVariant::Int )
|
if ( attributeType == QVariant::Int )
|
||||||
attElem.setAttribute( QStringLiteral( "type" ), QStringLiteral( "integer" ) );
|
attElem.setAttribute( QStringLiteral( "type" ), QStringLiteral( "integer" ) );
|
||||||
|
@ -248,11 +248,17 @@ namespace QgsWfs
|
|||||||
QStringList::const_iterator plstIt;
|
QStringList::const_iterator plstIt;
|
||||||
QList<int> idxList;
|
QList<int> idxList;
|
||||||
QgsFields fields = vlayer->fields();
|
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;
|
QString fieldName;
|
||||||
for ( plstIt = propertyList.begin(); plstIt != propertyList.end(); ++plstIt )
|
for ( plstIt = propertyList.begin(); plstIt != propertyList.end(); ++plstIt )
|
||||||
{
|
{
|
||||||
fieldName = *plstIt;
|
fieldName = *plstIt;
|
||||||
int fieldNameIdx = fields.lookupField( fieldName );
|
int fieldNameIdx = propertynames.indexOf( fieldName );
|
||||||
if ( fieldNameIdx > -1 )
|
if ( fieldNameIdx > -1 )
|
||||||
{
|
{
|
||||||
idxList.append( fieldNameIdx );
|
idxList.append( fieldNameIdx );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user