[mapguide-users] WFS FDO Ignores Filter When RestrictToBBox is True

Crispin Hoult (TrueViewVisuals) crispin.hoult at linknode.co.uk
Tue Jul 15 14:25:15 PDT 2025


Thanks Jackie,

I pasted this comment into the ticket - perhaps comment in there to keep a public thread and for anyone searching in future:


OK, so though I was expecting something like the query below I hadn't realised in the WFS specification

>> 7.9.2.5.2 KVP encoding
>> For KVP-encoded requests the selection clause shall be encoded using
>> one of the keywords
>> FILTER, RESOURCEID or BBOX (see ISO 19143, Table 2).

So it is *NOT* possible to combine a BBOX with a FILTER

I guess my comment now is that this implementation of restrictToBBox (without an RFC) has effectively created a different FDO provider that had different capabilities.  The WFS provider publishes it's capabilities as ExpressionType_Basic with ConditionType_Comparison as well as ConditionType_Spatial.
However, when the restrictToBBox=True the ONLY ConditionType is Spatial.  The problem is that the capabilities are at the provider level and not at the connection string and so applications (like commercial AutoCAD Map) and others will present a WFS interface that allows property queries to be created but these will never be executed - resulting in a user experience of different resultsset than specified/expected.

{{{
http://ogc.bgs.ac.uk/digmap625k_gsml_insp_gs/wfs?version=2.0.0
&service=WFS
&REQUEST=GetFeature&service=WFS
&TYPENAMES=gsmlp:GBR_BGS_625k_BA_INSP&REQUEST=GetFeature
&BBOX=200000.0,600000.0,300000.0,700000.0,urn:ogc:def:crs:EPSG::27700&TYPENAMES=gsmlp:GBR_BGS_625k_BA_INSP
&SRSNAME=urn:ogc:def:crs:EPSG::27700
&Filter=<Filter xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:gsmlp="http://xmlns.geosciml.org/geosciml-portrayal/4.0"><PropertyIsEqualTo><PropertyName>lithology</PropertyName><Literal>Basalt</Literal></PropertyIsEqualTo></Filter>
}}}

 Best regards,

  Crispin

________________________________
From: mapguide-users <mapguide-users-bounces at lists.osgeo.org> on behalf of Jackie Ng via mapguide-users <mapguide-users at lists.osgeo.org>
Sent: Tuesday, July 15, 2025 11:21 AM
To: MapGuide Users Mail List <mapguide-users at lists.osgeo.org>
Subject: Re: [mapguide-users] WFS FDO Ignores Filter When RestrictToBBox is True

I had some time to look at the issue in question and if we trace back to the original commit message in https://trac.osgeo.org/fdo/changeset/8194

WFS Provider: Some WFS servers support BBOX filter only, but don't support normal filter. Some other servers support normal filter only, but don't support BBOX filter. In order to handle the 2 kinds of WFS servers, we add a new configuration item RestrictToBBox. If it is true, FDO WFS provider will generate BBOX filter for queries. Otherwise, it will generate normal filter as before

Based on my interpretation of that commit message, I believe this would be intentional behavior. This setting seems to only be enabled to handle a specific kind of WFS server which if your example WFS server is producing the correct results when this setting is false then perhaps it's just a case of not turning on this setting?

- Jackie


On Thu, 10 Jul 2025 at 21:14, Jackie Ng wrote:
Hi Crispin,

Thanks for the bug report.

I'm somewhat busy this week, so I'll take a look at this early next week.

- Jackie

You wrote:

Hi,

I documented this more at https://trac.osgeo.org/fdo/ticket/1009 but think that is fairly unmonitored and as it obviously affects MGOS4 I hope it can get some attention as affecting MapGuide issue.
As MGS is by it's nature as a web mapping viewer, it applies a BBox / Intersects query for every web map page request.
The issue is that if the new format RestrictToBBox = True is applied to the WFS query connection parameters then all property/aspatial filters are stripped/ignored when sent to the WFS server; resulting in an unexpected return of ALL data within the map window.

See sample MGP package attached, based on open British Geological Survey data. The attached screen grab shows the WebLayout preview highlighting in red Basalt lithography (use the WebLayout as it zooms/centres to a sensible scale and area).  The initial display used the connection format WITHOUT the BBox parameter.
If the other Filtered themed layer is turned on, even though it has a filter for lithology='Basalt', all data is returned.
It is the BBox parameter that results in unexpected results, even though filter and BBox are possible.

See FDO ticket for details or use Fiddler etc and apply proxy parameters to the WFS connection to capture web traffc.

 Best regards,

  Crispin



--
http://themapguyde.blogspot.com

Tel: +44 141 374 2741<tel:+441413742741>
Web: TrueViewVisuals.com<https://trueviewvisuals.com/> and RoadsOnline.co.uk<https://www.roadsonline.co.uk/>

[TVV and LCRIG - RoadsOnline]
This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapguide-users/attachments/20250715/fde5ee54/attachment.htm>


More information about the mapguide-users mailing list