SLD and WFS: filters
Yewondwossen Assefa
assefa at DMSOLUTIONS.CA
Wed Apr 4 10:16:26 EDT 2007
Bart,
When using the filter encoding (in wms and wfs), if the filter is
"simple" enough, It will be translated into expressions set on the
layers filter parameter (see bug 1292 on discussions related to this
:http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1292).
So in your case, you end up setting the filter with something like
"WHERE (KW_KWALITE> 3)"
The error you are seeing is produced I think at the OGR level when
validating the expression (so verifying things like numeric comparison
is done with only numeric fields).
The filter encoding inside the SLD should theoretically use the same
logic (for simple expressions and OGR layer, It would set the filter
parameter and do then do the query). Looking quickly in the code, I am
not sure where the problem lies. I am willing to investigate if you can
send me map/data to reproduce.
Later,
Bart van den Eijnden (OSGIS) wrote:
> Hi list,
>
> does the Mapserver SLD code handle filters differently than the WFS code?
>
> We've run into the following problem that suggests the above. I suspect
> that, for SLD, Mapserver internally will do the query and for WFS Mapserver
> will let OGR do it.
>
> Our SLD works fine, but if we use the same ogc:Filter in WFS it fails with:
>
> msOGRFileWhichShapes(): OGR error. SetAttributeFilter( (KW_KWALITE> 3) )
> failed on layer kw20070131.
> Attempt to use STRING field `KW_KWALITE' with numeric comparison `>'.
>
> So apparently OGR cannot handle the > operator on a string field, but
> Mapserver can?
>
> Shouldn't the two interfaces (SLD WMS and WFS) use the same approach
> otherwise this can lead to inconsistent results?
>
> Best regards,
> Bart
>
> --
> Bart van den Eijnden
> OSGIS, Open Source GIS
> http://www.osgis.nl
>
--
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst
Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/
Phone: (613) 565-5056 (ext 14)
Fax: (613) 565-0925
----------------------------------------------------------------
More information about the mapserver-dev
mailing list