Skip to content

Commit ebd1022

Browse files
committed
Do not add geometry if not necessary in json export
1 parent 101cd73 commit ebd1022

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/server/services/wms/qgswmsrenderer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2282,6 +2282,8 @@ namespace QgsWms
22822282
{
22832283
QString json;
22842284

2285+
const bool withGeometry = ( QgsServerProjectUtils::wmsFeatureInfoAddWktGeometry( *mProject ) && mWmsParameters.withGeometry() );
2286+
22852287
const QDomNodeList layerList = doc.elementsByTagName( QStringLiteral( "Layer" ) );
22862288
for ( int i = 0; i < layerList.size(); ++i )
22872289
{
@@ -2317,7 +2319,7 @@ namespace QgsWms
23172319
const QgsFeature feature = vl->getFeature( fid );
23182320
features.append( feature );
23192321

2320-
// search attributes to export
2322+
// search attributes to export (one time only)
23212323
if ( not attributes.isEmpty() )
23222324
continue;
23232325

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

0 commit comments

Comments
 (0)