Skip to content
Permalink
Browse files

Fix OGC tests

  • Loading branch information
pblottiere committed Mar 10, 2021
1 parent c21a1ca commit c23577fdf3641b336099c07b74127337cc0cb964
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/server/services/wms/qgswmsgetcapabilities.cpp
@@ -1065,13 +1065,15 @@ namespace QgsWms

//Ex_GeographicBoundingBox
QgsRectangle extent = l->extent(); // layer extent by default
QgsRectangle geoExtent = l->geographicExtent();
if ( l->type() == QgsMapLayerType::VectorLayer )
{
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( l );
if ( vl && vl->featureCount() == 0 )
{
// if there's no feature, use the wms extent defined in the
// project...
geoExtent = QgsRectangle();
extent = QgsServerProjectUtils::wmsExtent( *project );
if ( extent.isNull() )
{
@@ -1095,7 +1097,7 @@ namespace QgsWms
}
}

appendLayerBoundingBoxes( doc, layerElem, extent, l->crs(), crsList, outputCrsList, project, l->geographicExtent() );
appendLayerBoundingBoxes( doc, layerElem, extent, l->crs(), crsList, outputCrsList, project, geoExtent );
}

// add details about supported styles of the layer
@@ -1453,6 +1455,12 @@ namespace QgsWms
}
}

if ( qgsDoubleNear( wgs84BoundingRect.xMinimum(), wgs84BoundingRect.xMaximum() ) || qgsDoubleNear( wgs84BoundingRect.yMinimum(), wgs84BoundingRect.yMaximum() ) )
{
//layer bbox cannot be empty
wgs84BoundingRect.grow( 0.000001 );
}

//Ex_GeographicBoundingBox
int wgs84precision = 6;
QDomElement ExGeoBBoxElement;

0 comments on commit c23577f

Please sign in to comment.