I have MapServer setup to display data (both WMS and WFS), however I'm having a problem adding a default filter.
There's is an area on the map that users should not be able to retrieve features from. I have the coordinates of this area so basically, I need to setup a default spatial filter to exclude features that are contained within this area. Removing the data itself isn't an option.
The layers are all OGR layers.
I can construct a client side filter to do this, however this should really be a server-side setting.
How should I go about doing this?
Ignoring the spatial requirement for a second, I'm having problems getting even a basic filter to work. If I append the following to the URL of a WFS request, this filter works as expected:
(Note this filter has no actual relevance, it's just a simple filter so I can check if it's being applied)
&FILTER="<PropertyIsGreaterThan><PropertyName>ID</PropertyName><Literal>916</Literal></PropertyIsGreaterThan>"
However, if in the map file I set the following:
LAYER
...
FILTER "<PropertyIsGreaterThan><PropertyName>ID</PropertyName><Literal>916</Literal></PropertyIsGreaterThan>"
...
END
Then I get no results from any query on that layer. Wrapping the filter in <Filter>
tags has the same result.
I've also tried similar with the wfs_filter
property, which doesn't seem to have any affect at all. (If I understand correctly, this is only used when using MapServer as a WFS Client?)
I'd appreciate any help.
Thanks :)