Skip to content
Permalink
Browse files

Do not add geometry if not necessary in json export

  • Loading branch information
pblottiere committed Jan 28, 2019
1 parent 101cd73 commit ebd10222141caf668981f1c97008a496e295f8d5
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/server/services/wms/qgswmsrenderer.cpp
@@ -2282,6 +2282,8 @@ namespace QgsWms
{
QString json;

const bool withGeometry = ( QgsServerProjectUtils::wmsFeatureInfoAddWktGeometry( *mProject ) && mWmsParameters.withGeometry() );

const QDomNodeList layerList = doc.elementsByTagName( QStringLiteral( "Layer" ) );
for ( int i = 0; i < layerList.size(); ++i )
{
@@ -2317,7 +2319,7 @@ namespace QgsWms
const QgsFeature feature = vl->getFeature( fid );
features.append( feature );

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

@@ -2335,6 +2337,7 @@ namespace QgsWms
// export
QgsJsonExporter exporter( vl );
exporter.setAttributes( attributes );
exporter.setIncludeGeometry( withGeometry );
json.append( exporter.exportFeatures( features ) );
}
else // raster layer

0 comments on commit ebd1022

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