[OpenLayers-Users] Creating an ogc:Filter combining ogc:BBOX and others

Christopher Schmidt crschmidt at metacarta.com
Thu Apr 23 12:27:44 EDT 2009


On Thu, Apr 23, 2009 at 09:08:02AM -0700, dalsinao wrote:
> 
> Hello,
> 
> I have seen that there are some changes in the WFS protocol coming in the
> next release.
> One that particularly affects me is that now the BBOX parameter is not
> always added in the WFS requests as before. That's fine, but now I have a
> related question.

I'm curious how this affects you. I'm assuming you're currently using
the Layer.WFS code, and you're speaking of the change that causes the
WFS layer to not send the bbox when there is a 'filter' in the
paramters. Since no existing server that I'm aware of supported both
'filter' and 'bbox' -- because the spec says you shouldn't, as I
understand it -- I don't know how this could cause things that were
working before to stop working. Can you explain this?

> If you have your own ogc:filter and you want to combine it with BBOX, how
> can you do it?

"Use the WFS Protocol, instead of Layer.WFS." Someone who is more
fmailiar with the WFS Protocol can probably give you more help here.

> I would like to combine my ogc:filter (static) with the dynamically
> generated ogc:BBOX filter (changing according to the viewport I understand). 
> 
> Is it possible to do so? and if so, how? 
> 
> I have seen the example in wfs-protocol.html, using "strategies" and
> "protocol", which at the end produces an HTTP/POST request having an
> ogc:filter like the one (for WFS 1.1.0):
> 
> <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
>     <ogc:BBOX>
>         <ogc:PropertyName>the_geom</ogc:PropertyName>
>         <gml:Envelope xmlns:gml="http://www.opengis.net/gml"
> srsName="EPSG:4326">
>             <gml:lowerCorner>-37.4060546875 15.1189453125</gml:lowerCorner>
>             <gml:upperCorner>-14.9939453125 26.2810546875</gml:upperCorner>
>         </gml:Envelope>
>     </ogc:BBOX>
> </ogc:Filter>
> 
> What I would like to do is to combine this ogc:filter with mine to get e.g
> something like this:
> 
> <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
>     <ogc:And>
>         <ogc:BBOX>
>             <ogc:PropertyName>the_geom</ogc:PropertyName>
>             <gml:Envelope xmlns:gml="http://www.opengis.net/gml"
> srsName="EPSG:4326">
>                 <gml:lowerCorner>-37.4060546875
> 15.1189453125</gml:lowerCorner>
>                 <gml:upperCorner>-14.9939453125
> 26.2810546875</gml:upperCorner>
>             </gml:Envelope>
>         </ogc:BBOX>
>         <ogc:PropertyIsEqualTo>
>             <ogc:PropertyName>Scenario</ogc:PropertyName>
>             <ogc:Literal>Demo</
>             ogc:Literal>
>         </ogc:PropertyIsEqualTo>
>     </ogc:And>
> </ogc:Filter>
> 
> 
> And parallel to this. Is it the intention in the long term to get rid of the
> OpenLayers.Layer.WFS layer and use only the OpenLayers.Layer.Vector?

Yes.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list