Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WMS 1.3.0 compliance: If a layer bounding box is there, it is not all…
…owed to be empty (also if a layer has only one point)
  • Loading branch information
mhugent authored and rldhont committed Dec 12, 2016
1 parent 763c9b7 commit 9561f71
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/server/qgsconfigparserutils.cpp
Expand Up @@ -80,14 +80,21 @@ void QgsConfigParserUtils::appendCRSElementToLayer( QDomElement& layerElement, c
layerElement.insertAfter( crsElement, precedingElement ); 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 ) const QgsCoordinateReferenceSystem& layerCRS, const QStringList &crsList, const QStringList& constrainedCrsList )
{ {
if ( layerElem.isNull() ) if ( layerElem.isNull() )
{ {
return; 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 = QgsCRSCache::instance()->crsByOgcWmsCrs( GEO_EPSG_CRS_AUTHID ); QgsCoordinateReferenceSystem wgs84 = QgsCRSCache::instance()->crsByOgcWmsCrs( GEO_EPSG_CRS_AUTHID );


QString version = doc.documentElement().attribute( "version" ); QString version = doc.documentElement().attribute( "version" );
Expand Down

0 comments on commit 9561f71

Please sign in to comment.