[mapserver-users] Mapserver <ogc:Filter> fails against Geoserver WFS

Michal Šrédl michal.sredl at gmail.com
Fri Jan 6 04:51:53 EST 2012


Dear all,

I am not able to use WFS filter in Mapserver Mapfile against the
Geoserver WFS, apparently as Mapserver produces invalid XML as the
final filter that goes to the request.

In Mapfile, I say

LAYER
  METADATA
      "wfs_filter"  '<ogc:PropertyIsEqualTo
xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyName>STUPEN</ogc:PropertyName><ogc:Literal>3</ogc:Literal></ogc:PropertyIsEqualTo>'

(the whole Mapfile is attached)

The request that leaves Mapserver towards the Geoserver WFS looks like this:

http://88.81.191.230:8080/geoserver/ows?&REQUEST=GetFeature&VERSION=1.0.0&SERVICE=WFS&TYPENAME=ccss:Flood2010_FloodActivityGrade&FILTER=<ogc:Filter><ogc:PropertyIsEqualTo+xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyName>STUPEN</ogc:PropertyName><ogc:Literal>3</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>

Please note the <ogc:Filter> filter tag - with namespace used, but not
defined. This is an issue, as it is not valid and Geoserver replies
with an exception.

Changing manually the filter tag either to <Filter> or
<ogc:Filter+xmlns:ogc="http://www.opengis.net/ogc"> makes the whole
thing work. Unfortunately, the Mapserver documentation [1] says, that

"The filter given as a value of the wfs_filter metadata should not
contain <Filter> start and end tags."

So whatever I provide as the "wfs_filter" value, is later broken by
<ogc:Filter> tag.

Do you consider it a bug? Or is there any way how to make Mapserver to
create the filter as valid XML? Or let me include the <Filter> tag in
the "wfs_filter"?

Thank you for your advice,

Michal


Note: Mapserver itself wouldn't mind such a behaviour and would accept
such a request, e.g. this one:

http://bnhelp.cz/cgi-bin/crwfs/cgi-bin/crwfs?&REQUEST=GetFeature&VERSION=1.0.0&SERVICE=WFS&TYPENAME=okresy&FILTER=<ogc:Filter><ogc:PropertyIsLessThan+xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyName>KODOK</ogc:PropertyName><ogc:Literal>3555</ogc:Literal></ogc:PropertyIsLessThan></ogc:Filter>

But Geoserver is not that tolerant...


[1] http://mapserver.org/ogc/filter_encoding.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mapfile.fes
Type: application/octet-stream
Size: 14738 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120106/803da6af/mapfile.obj


More information about the mapserver-users mailing list