Skip to content
Permalink
Browse files

Fixes #5520 - Invalid BBOX in WMS GetCapabilities

  • Loading branch information
pblottiere committed Oct 18, 2018
1 parent 2fce570 commit da22f7ccac76a28691e0daeda9debd21cd182586
Showing with 18 additions and 1 deletion.
  1. +18 −1 src/server/services/wms/qgswmsgetcapabilities.cpp
@@ -1017,7 +1017,24 @@ namespace QgsWms
appendCrsElementsToLayer( doc, layerElem, crsList, outputCrsList );

//Ex_GeographicBoundingBox
appendLayerBoundingBoxes( doc, layerElem, l->extent(), l->crs(), crsList, outputCrsList, project );
QgsRectangle extent = l->extent(); // layer extent by default
if ( l->type() == QgsMapLayer::VectorLayer )
{
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( l );
if ( vl && vl->featureCount() == 0 )
{
// if there's no feature, use the wms extent defined in the
// project...
extent = QgsServerProjectUtils::wmsExtent( *project );
if ( extent.isNull() )
{
// or the CRS extent otherwise
extent = vl->crs().bounds();
}
}
}

appendLayerBoundingBoxes( doc, layerElem, extent, l->crs(), crsList, outputCrsList, project );
}

// add details about supported styles of the layer

0 comments on commit da22f7c

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