Skip to content
Permalink
Browse files

Some cleaning

  • Loading branch information
pblottiere committed Jan 18, 2019
1 parent 8e3f7b1 commit 0f24e72bd52a5bb1f4bdc0b7f634e112703f0a4a
Showing with 19 additions and 18 deletions.
  1. +18 −18 src/server/services/wms/qgswmsrenderer.cpp
  2. +1 −0 src/server/services/wms/qgswmsrenderer.h
@@ -2312,27 +2312,27 @@ namespace QgsWms
QgsFeatureList features;
QgsAttributeList attributes;
const QDomNodeList featuresNode = layerElem.elementsByTagName( QStringLiteral( "Feature" ) );
if ( !featuresNode.isEmpty() )
if ( featuresNode.isEmpty() )
continue;

for ( int j = 0; j < featuresNode.size(); ++j )
{
for ( int j = 0; j < featuresNode.size(); ++j )
{
const QDomElement featureNode = featuresNode.at( j ).toElement();
const qint64 fid = featureNode.attribute( QStringLiteral( "id" ) ).toLongLong();
const QgsFeature feature = vl->getFeature( fid );
features.append( feature );
const QDomElement featureNode = featuresNode.at( j ).toElement();
const qint64 fid = featureNode.attribute( QStringLiteral( "id" ) ).toLongLong();
const QgsFeature feature = vl->getFeature( fid );
features << feature;

// search attributes to export (one time only)
if ( not attributes.isEmpty() )
continue;
// search attributes to export (one time only)
if ( not attributes.isEmpty() )
continue;

const QDomNodeList attributesNode = featureNode.elementsByTagName( QStringLiteral( "Attribute" ) );
for ( int k = 0; k < attributesNode.size(); ++k )
{
const QDomElement attributeElement = attributesNode.at( k ).toElement();
const QString fieldName = attributeElement.attribute( QStringLiteral( "name" ) );
const QDomNodeList attributesNode = featureNode.elementsByTagName( QStringLiteral( "Attribute" ) );
for ( int k = 0; k < attributesNode.size(); ++k )
{
const QDomElement attributeElement = attributesNode.at( k ).toElement();
const QString fieldName = attributeElement.attribute( QStringLiteral( "name" ) );

attributes << feature.fieldNameIndex( fieldName );
}
attributes << feature.fieldNameIndex( fieldName );
}
}

@@ -2369,7 +2369,7 @@ namespace QgsWms
}
}

json.append( ( "]}" ) );
json.append( QStringLiteral( "]}" ) );

return json.toUtf8();
}
@@ -255,6 +255,7 @@ namespace QgsWms
//! Converts a feature info xml document to Text
QByteArray convertFeatureInfoToText( const QDomDocument &doc ) const;

//! Converts a feature info xml document to json
QByteArray convertFeatureInfoToJson( const QList<QgsMapLayer *> &layers, const QDomDocument &doc ) const;

QDomElement createFeatureGML(

0 comments on commit 0f24e72

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