AnsweredAssumed Answered

How to construct a WFS-URL that both filters on an attribute and uses a boudingbox filter

Question asked by madagasie on Feb 6, 2015
Latest reply on Feb 25, 2015 by madagasie

Dear community,

 

In an attempt not to request too many features from a WFS i'd like to apply both a attribute filter and a bounding box/envelope. Although these two types of filters seem to be "mutually exclusive" according to the OGC specification, I was wondering if they could somehow be combined within a single filter through for example the use of the AND-operator. Anyone any advise? I am working on the following WFS: http://geodata.nationaalgeoregister.nl/bag/wfs?request=getcapabilities

 

What I've tried, but doesn't work out is:

 

1:Via the url

 

http://geodata.nationaalgeoregister.nl/bag/wfs?&typename=bag:pand&version=2.0.0&request=getfeature&Filter=<ogc:Filter xmlns=&quot;http://www.opengis.net/wfs/2.0 xmlns:gml=http://schemas.opengis.net/gml xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:bag=http://bag.geonovum.nl xsi:schemaLocation=http://www.opengis.net/wfs/2.0 &quot;><And><ogc:BBOX><ogc:PropertyName>Shape</ogc:PropertyName><gml:Box srsName=&quot;urn:x-ogc:def:crs:EPSG:28992&quot;><gml:coordinates>508576,107240 510167,109000</gml:coordinates></gml:Box></ogc:BBOX><Within><PropertyIsEqualTo><PropertyName>status</PropertyName><Literal>Bouwvergunning verleend</Literal></PropertyIsEqualTo></Within></And></ogc:Filter>

 

2:via use of the xml-filter expression

 

<ogc:Filter>

  <ogc:And>

    <ogc:PropertyIsEqualTo>

      <ogc:PropertyName>status</ogc:PropertyName>

      <ogc:Literal>Bouwvergunning verleend</ogc:Literal>

    </ogc:PropertyIsEqualTo>

    <gml:boundedBy>

      <gml:Envelope srsDimension="2" srsName="urn:ogc:def:crs:EPSG::28992">

        <gml:lowerCorner>107240 508576</gml:lowerCorner>

        <gml:upperCorner>109000 510167</gml:upperCorner>

      </gml:Envelope>

    </gml:boundedBy>

    </ogc:And>

</ogc:Filter>

 

source used: http://gdsc.nlr.nl/gdsc/en/software/excat/manual/ogcfilter_examples

 

Any advice is much appreciated!

 

Cheers!

Outcomes