Hi, folks ...

I have an situation where I need a WMS query and a WFS query to match each
other, with both the right bbox and filter (the WFS query needs to return
the same set of features as is displayed on the tile). The WMS query works
just fine with the bbox and filter.

As I learned, a WFS request cannot have both a bbox and filter, the bbox
must be integrated into the filter. So I came up with two different filters.

WMS request parameters (from developer console):

LAYERS: xxx
STYLES: xxx
FORMAT: image/png
SERVICE: WMS
REQUEST: GetMap
VERSION: 1.1.1
TRANSPARENT: TRUE
FILTER: <And>   <PropertyIsEqualTo>
 <PropertyName>properties.status</PropertyName>
 <Literal>Terminated</Literal>   </PropertyIsEqualTo>   <And>
 <PropertyIsLessThan>
<PropertyName>properties.actual.startTime</PropertyName>         <Function
name="dateParse">            <Literal>yyyy-MM-dd'T'HH:mm:ssXXX</Literal>
         <Literal>2019-10-01T09:00:00-07:00</Literal>         </Function>
   </PropertyIsLessThan>      <PropertyIsGreaterThan>
<PropertyName>properties.actual.endTime</PropertyName>         <Function
name="dateParse">            <Literal>yyyy-MM-dd'T'HH:mm:ssXXX</Literal>
         <Literal>2019-10-01T08:00:00-07:00</Literal>         </Function>
   </PropertyIsGreaterThan>   </And></And>
BBOX: -13632748.557201,4455827.3255735,-13511978.052511,4513995.9040985
SRS: EPSG:102113
WIDTH: 1580
HEIGHT: 761

WFS request parameters:

service: WFS
version: 1.0.0
request: GetFeature
typeName: xxx
FILTER: <And>   <And>   <PropertyIsEqualTo>
 <PropertyName>properties.status</PropertyName>
 <Literal>Terminated</Literal>   </PropertyIsEqualTo>
 <ogc:BBOX><ogc:PropertyName>geometry</ogc:PropertyName><gml:Box xmlns:gml="
http://www.opengis.net/gml";
srsName="urn:x-ogc:def:crs:EPSG:102113"><gml:coordinates>-13632748.557201,4455827.325574,-13511978.052511,4513995.904099</gml:coordinates></gml:Box></ogc:BBOX></And>
  <And>      <PropertyIsLessThan>
<PropertyName>properties.actual.startTime</PropertyName>         <Function
name="dateParse">            <Literal>yyyy-MM-dd'T'HH:mm:ssXXX</Literal>
         <Literal>2019-10-01T09:00:00-07:00</Literal>         </Function>
   </PropertyIsLessThan>      <PropertyIsGreaterThan>
<PropertyName>properties.actual.endTime</PropertyName>         <Function
name="dateParse">            <Literal>yyyy-MM-dd'T'HH:mm:ssXXX</Literal>
         <Literal>2019-10-01T08:00:00-07:00</Literal>         </Function>
   </PropertyIsGreaterThan>   </And></And>
outputFormat: application/json

I have moved that BBOX declaration around in the wfs filter and exactly the
same thing continues to happen. It seems to completely ignore the status
filter and date range filter and dump the thousands of records from the
database out to the browser.

If I remove the BBOX from the WFS filter, the WFS request matches the WMS
request except for the boundary box limitations (the status and date range
are handled correctly).

What am I doing wrong here?
Thanks.
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to