Skip to content
Permalink
Browse files

[Server][WFS] GeoJSON FeatureCollection BBOX is restricted to -180,-9…

…0,180,90
  • Loading branch information
rldhont committed May 26, 2018
1 parent 4bb7f82 commit c8a5992b2b85b061823a0b32013bc7289d9015f7
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/server/services/wfs/qgswfsgetfeature.cpp
@@ -1043,7 +1043,7 @@ namespace QgsWfs
{
response.setHeader( "Content-Type", "application/vnd.geo+json; charset=utf-8" );

if ( crs.isValid() )
if ( crs.isValid() && !rect->isEmpty() )
{
QgsGeometry exportGeom = QgsGeometry::fromRect( *rect );
QgsCoordinateTransform transform;
@@ -1062,6 +1062,9 @@ namespace QgsWfs
Q_UNUSED( cse );
}
}
// EPSG:4326 max extent is -180, -90, 180, 90
rect = new QgsRectangle( rect->intersect( new QgsRectangle( -180.0, -90.0, 180.0, 90.0 ) ) );

fcString = QStringLiteral( "{\"type\": \"FeatureCollection\",\n" );
fcString += " \"bbox\": [ " + qgsDoubleToString( rect->xMinimum(), prec ) + ", " + qgsDoubleToString( rect->yMinimum(), prec ) + ", " + qgsDoubleToString( rect->xMaximum(), prec ) + ", " + qgsDoubleToString( rect->yMaximum(), prec ) + "],\n";
fcString += QLatin1String( " \"features\": [\n" );

0 comments on commit c8a5992

Please sign in to comment.
You can’t perform that action at this time.