[mapserver-users] Mapserver Layer Filter
hawk at aamdal.com
Thu Jan 12 11:24:02 EST 2012
Hi there, Mailing List,
We have a customer that wants their maps to be published online, but some of
the features is confidential and should not be displayed.
We have added following to the layer definition:
FILTER ('[type]' != "GRØFT ")
It works, the features with type GRØFT are not showed in the map.
However, we have a window that let the user browse the data, and it will be
possible to access the features of type GRØFT. When you press show in map,
elements with the current ID. By doing this, WFS omits the LAYER FILTER
definition, so the element can be showed in the map, even if it is of type
GRØFT. I need a way to make sure the WFS cant deliver any data of type
Ive seen three possible solutions:
1. We have a service that automatically converts uploaded MapInfo
*.TAB-files to SHP. If I am correct, I could use the -where-argument on
the ogr2ogr to filter data and only get features which does not have type
GRØFT. I hope I do not have to do this, since debugging and developing a
windows service is quite tricky.
2. Add additional filter values to the WFS query. I could also define
automatically add <PropertyIsNotEqualTo>-tags to the AJAX query. This would
be less secure, and I need to define types not to show at two places.
3. The best solution in my eyes is to let the magic happen in the
MAP-file, and that is mostly why I am posting here. Is there a way to add a
query to the Layer Data definition, like you do if you are querying a MSSQL
database? I can imagine a syntax like this:
DATA "SELECT * FROM tm_points WHERE type!=GRØFT
It does not seem to work.
Any suggestions, especially regarding the third solution?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mapserver-users