Skip to content

Commit

Permalink
Merge pull request #34145 from qgis-bot/backport-33598-to-release-3_10
Browse files Browse the repository at this point in the history
[Backport release-3_10] wfs server: don't report unsupported DWithin/Beyond in capabilities and properly report failure to decode filters containing them
  • Loading branch information
rldhont committed Feb 13, 2020
2 parents 900732b + a65d351 commit e4efa4f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/server/services/wfs/qgswfsgetcapabilities.cpp
Expand Up @@ -126,8 +126,7 @@ namespace QgsWfs
QStringList spatialOperators;
spatialOperators << QStringLiteral( "Equals" ) << QStringLiteral( "Disjoint" ) << QStringLiteral( "Touches" )
<< QStringLiteral( "Within" ) << QStringLiteral( "Overlaps" ) << QStringLiteral( "Crosses" )
<< QStringLiteral( "Intersects" ) << QStringLiteral( "Contains" ) << QStringLiteral( "DWithin" )
<< QStringLiteral( "Beyond" ) << QStringLiteral( "BBOX" );
<< QStringLiteral( "Intersects" ) << QStringLiteral( "Contains" ) << QStringLiteral( "BBOX" );
QDomElement spatialOperatorsElem = doc.createElement( QStringLiteral( "ogc:SpatialOperators" ) );
for ( const QString &spatialOperator : spatialOperators )
{
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/wfs/qgswfsutils.cpp
Expand Up @@ -281,7 +281,7 @@ namespace QgsWfs
std::shared_ptr<QgsExpression> filter( QgsOgcUtils::expressionFromOgcFilter( filterElem, layer ) );
if ( filter )
{
if ( filter->hasParserError() )
if ( filter->hasParserError() || !filter->parserErrorString().isEmpty() )
{
throw QgsRequestNotWellFormedException( filter->parserErrorString() );
}
Expand Down
2 changes: 0 additions & 2 deletions tests/testdata/qgis_server/wfs_getcapabilities.txt
Expand Up @@ -122,8 +122,6 @@ Content-Type: text/xml; charset=utf-8
<ogc:SpatialOperator name="Crosses"/>
<ogc:SpatialOperator name="Intersects"/>
<ogc:SpatialOperator name="Contains"/>
<ogc:SpatialOperator name="DWithin"/>
<ogc:SpatialOperator name="Beyond"/>
<ogc:SpatialOperator name="BBOX"/>
</ogc:SpatialOperators>
</ogc:Spatial_Capabilities>
Expand Down

0 comments on commit e4efa4f

Please sign in to comment.