Skip to content

Commit

Permalink
qgswfsgetcapabilities: Restore previous empty bounding box behavior
Browse files Browse the repository at this point in the history
According to the WFS 1.1.0 specs "The <WGS84BoundingBox> element is
used to indicate the edges of an enclosing rectangle in decimal
degrees of latitude and longitude in WGS84" but the expected behavior
is not specified when the data are empty.

Up to QGIS 3.32, QGIS server returned:
```
<ows:WGS84BoundingBox dimensions="2">
<ows:LowerCorner>0 0</ows:LowerCorner>
<ows:UpperCorner>0 0</ows:UpperCorner>
```

However, as a side effect of a change in `QGSRectangle` (see:
qgis#54646), QGIS server now returns
since the 3.34 version:
```
<ows:WGS84BoundingBox dimensions="2">
<ows:LowerCorner>inf inf</ows:LowerCorner>
<ows:UpperCorner>-inf -inf</ows:UpperCorner>
```

This changes restores the QGIS 3.32 behavior.
  • Loading branch information
ptitjano committed Jan 22, 2024
1 parent 2e7c0e6 commit 97e9a43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/services/wfs/qgswfsgetcapabilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ namespace QgsWfs
//transform the layers native CRS into WGS84
const QgsCoordinateReferenceSystem wgs84 = QgsCoordinateReferenceSystem::fromOgcWmsCrs( geoEpsgCrsAuthId() );
const int wgs84precision = 6;
QgsRectangle wgs84BoundingRect;
QgsRectangle wgs84BoundingRect( 0, 0, 0, 0 );
if ( !layerExtent.isNull() )
{
const QgsCoordinateTransform exGeoTransform( layer->crs(), wgs84, project );
Expand All @@ -592,7 +592,7 @@ namespace QgsWfs
}
catch ( const QgsCsException & )
{
wgs84BoundingRect = QgsRectangle();
wgs84BoundingRect = QgsRectangle( 0, 0, 0, 0 );
}
}

Expand Down

0 comments on commit 97e9a43

Please sign in to comment.