WMS 1.3.0 compliance: If a layer bounding box is there, it is not allowed to be empty (also if a layer has only one point)

This commit is contained in:
Marco Hugentobler 2016-11-29 14:36:14 +01:00
parent 1fd290f243
commit 1bc6ee3343

View File

@ -80,7 +80,7 @@ void QgsConfigParserUtils::appendCrsElementToLayer( QDomElement& layerElement, c
layerElement.insertAfter( crsElement, precedingElement );
}
void QgsConfigParserUtils::appendLayerBoundingBoxes( QDomElement& layerElem, QDomDocument& doc, const QgsRectangle& layerExtent,
void QgsConfigParserUtils::appendLayerBoundingBoxes( QDomElement& layerElem, QDomDocument& doc, const QgsRectangle& lExtent,
const QgsCoordinateReferenceSystem& layerCRS, const QStringList &crsList, const QStringList& constrainedCrsList )
{
if ( layerElem.isNull() )
@ -88,6 +88,13 @@ void QgsConfigParserUtils::appendLayerBoundingBoxes( QDomElement& layerElem, QDo
return;
}
QgsRectangle layerExtent = lExtent;
if ( qgsDoubleNear( layerExtent.xMinimum(), layerExtent.xMaximum() ) || qgsDoubleNear( layerExtent.yMinimum(), layerExtent.yMaximum() ) )
{
//layer bbox cannot be empty
layerExtent.grow( 0.000001 );
}
QgsCoordinateReferenceSystem wgs84 = QgsCoordinateReferenceSystem::fromOgcWmsCrs( GEO_EPSG_CRS_AUTHID );
QString version = doc.documentElement().attribute( QStringLiteral( "version" ) );