Skip to content
Permalink
Browse files

Merge pull request #6949 from m-kuhn/wms_overwrite_parent_boundingBoxes

Wms overwrite parent bounding boxes
  • Loading branch information
m-kuhn committed May 8, 2018
2 parents cfad3aa + 2ee479e commit be6a763b2f216f76527aeb3f3deec8c1050ce080
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/providers/wms/qgswmscapabilities.cpp
@@ -872,7 +872,6 @@ void QgsWmsCapabilities::parseLayer( QDomElement const &e, QgsWmsLayerProperty &
}
else if ( tagName == QLatin1String( "BoundingBox" ) )
{
// TODO: overwrite inherited
QgsWmsBoundingBoxProperty bbox;
bbox.box = QgsRectangle( e1.attribute( QStringLiteral( "minx" ) ).toDouble(),
e1.attribute( QStringLiteral( "miny" ) ).toDouble(),
@@ -893,7 +892,18 @@ void QgsWmsCapabilities::parseLayer( QDomElement const &e, QgsWmsLayerProperty &
bbox.box = invAxisBbox;
}

layerProperty.boundingBoxes << bbox;
// Overwrite existing bounding boxes with identical CRS
bool inheritedOverwritten = false;
for ( int i = 0; i < layerProperty.boundingBoxes.size(); i++ )
{
if ( layerProperty.boundingBoxes[i].crs == bbox.crs )
{
layerProperty.boundingBoxes[i] = bbox;
inheritedOverwritten = true;
}
}
if ( ! inheritedOverwritten )
layerProperty.boundingBoxes << bbox;
}
else
{

0 comments on commit be6a763

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