Opened 16 years ago
Last modified 16 years ago
#2571 assigned enhancement
Support OGC filters for CGI (and MapScript) queries....
Reported by: | sdlime | Owned by: | sdlime |
---|---|---|---|
Priority: | normal | Milestone: | 5.6 release |
Component: | MapServer CGI | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: | assefa, tomkralidis |
Description
MapServer OGC filter support is limited to SOS and WFS interfaces and it would be desirable to allow use of that method of encoding via MapScript and the CGI interface.
For MapScript this amounts to wrapping C-code with a queryByFilter() method attached to a mapObj or layerObj.
For the CGI there are a number of options:
- a new mode: filterquery and a new parameter: filter
- a new parameter: filter that if set would cause any of the query modes to use the filter
Steve
Change History (8)
comment:1 by , 16 years ago
Cc: | added |
---|
comment:2 by , 16 years ago
comment:3 by , 16 years ago
Status: | new → assigned |
---|
comment:4 by , 16 years ago
Steve,
You are right. These would be the functions to use:
FLTParseFilterEncoding : parse the filer string into a node type structure
FLTApplyFilterToLayer : to do the query FLTFreeFilterEncodingNode.
One thing though is that currently the FLTApplyFilterToLayer returns alway success so that the wfs user does not get any error message such "Search returned no results. No matching record(s) found.)" but a valid wfs message "missing" (with a bbox). I can certainly change it so that a failure is returned and update the wfs to behave properly.
comment:5 by , 16 years ago
We'll need a proper return code for the CGI and MapScript interfaces so anything you can do to make that work would be appreciated.
Steve
comment:6 by , 16 years ago
Milestone: | 5.2 release → 5.4 release |
---|
Assefa: Have you done any work in the WFS code to help with error handling? Will move to 5.4 regardless I think...
Steve
comment:7 by , 16 years ago
Steve,
I have it modified locally. Needs to check with msautotest. I will commit this week-end or Monday.
Assefa: Is FLTApplyFilterToLayer() the function that essentially does the query against a layer? If so I think I can pretty easily tackle this bug with a msQueryByFilter() function in mapquery.c. It would take a filter string (essentially the value of the FILTER parameter via WFS getFeature operations) and an optional query layer index. I believe some filters could be applied against all layers and others just against one. It would be the users responsibility to get that correct. I assume the filter code throws an error if the property to be used isn't present in a layer.
For the CGI, at least at this point, I think we could trigger in itemnquery mode and the user would just get qstring to be a filter. Just checking for </filter> in the qstring would be enough. If that were the case we'd call msQueryByFilter() return the result. MapScript would just wrap msQueryByFilter() directly.
Anyway, it looks like I just need to pull pieces of code from mapwfs.c...
Steve