Skip to content

Commit 9561f71

Browse files
mhugentrldhont
authored andcommitted
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)
1 parent 763c9b7 commit 9561f71

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/server/qgsconfigparserutils.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,21 @@ void QgsConfigParserUtils::appendCRSElementToLayer( QDomElement& layerElement, c
8080
layerElement.insertAfter( crsElement, precedingElement );
8181
}
8282

83-
void QgsConfigParserUtils::appendLayerBoundingBoxes( QDomElement& layerElem, QDomDocument& doc, const QgsRectangle& layerExtent,
83+
void QgsConfigParserUtils::appendLayerBoundingBoxes( QDomElement& layerElem, QDomDocument& doc, const QgsRectangle& lExtent,
8484
const QgsCoordinateReferenceSystem& layerCRS, const QStringList &crsList, const QStringList& constrainedCrsList )
8585
{
8686
if ( layerElem.isNull() )
8787
{
8888
return;
8989
}
9090

91+
QgsRectangle layerExtent = lExtent;
92+
if ( qgsDoubleNear( layerExtent.xMinimum(), layerExtent.xMaximum() ) || qgsDoubleNear( layerExtent.yMinimum(), layerExtent.yMaximum() ) )
93+
{
94+
//layer bbox cannot be empty
95+
layerExtent.grow( 0.000001 );
96+
}
97+
9198
QgsCoordinateReferenceSystem wgs84 = QgsCRSCache::instance()->crsByOgcWmsCrs( GEO_EPSG_CRS_AUTHID );
9299

93100
QString version = doc.documentElement().attribute( "version" );

0 commit comments

Comments
 (0)