Skip to content
Permalink
Browse files

Overwrite existing boundingBoxes with the same CRS in WMS capabilities.

  • Loading branch information
Roel authored and m-kuhn committed May 8, 2018
1 parent cdca708 commit a2a2d28d344b32d7f461fd716d9a4b36baabc695
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 a2a2d28

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