Thanks Andreas,
I tried to provide the complete filter with leading ogc:Filter
xmlns:ogc=http://www.opengis.net/ogc; tag and I had to cut it away
manually to make it work at least against another mapserver. Yes, I
can try to use Filter tag. I belive it can work against Geoserver.
But I already do know that it would not work against Intergraph
server. E.g. the following request can be broken by taking the
namespaces away:
http://portal.ingr.briseide.eu/TRACASA_VD12_WFS/wfservice.aspx?request=getfeatureservice=wfsversion=1.1.0typename=CATAST_POL_SUBPARURBAfilter=ogc:Filter+xmlns:ogc=http://www.opengis.net/ogc;ogc:PropertyIsLessThan+xmlns:ogc=http://www.opengis.net/ogc;ogc:PropertyNamePARCELA/ogc:PropertyNameogc:Literal200/ogc:Literal/ogc:PropertyIsLessThan/ogc:Filter
I don't dare to blame Intergraph in this case, as they are just
following FES and XML standards. I tried to use POST instead of GET,
and this is what I saw:
?xml version=1.0 ?
wfs:GetFeature service=WFS version=1.0.0 outputFormat=GML2
wfs:Query typeName=ccss:Flood2010_FloodActivityGrade
ogc:Filter
ogc:PropertyIsEqualTo
xmlns:ogc=http://www.opengis.net/ogc;ogc:PropertyNameSTUPEN/ogc:PropertyNameogc:Literal3/ogc:Literal/ogc:PropertyIsEqualTo
/ogc:Filter
/wfs:Query
/wfs:GetFeature
As you can see, this is again not a vaild XML as it does not define
the namespaces. Mapserver doesn't mind, but other servers are using
standard XML libraries to parse it and they can not.
Best Regards,
Michal
2012/1/9 Eichner, Andreas - SID-NLKM andreas.eich...@sid.sachsen.de:
At least in version 6.0.1 MapServer checks if a Filter or ogc:Filter tag
was given in wfs_filter metadata and uses this. So you should be able to use
Filter without a namespace prefix.
-Ursprüngliche Nachricht-
Von: mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] Im Auftrag
von Michal Šrédl
Gesendet: Freitag, 6. Januar 2012 10:52
An: mapserver-users@lists.osgeo.org
Cc: Premysl Vohnout; Jachym Cepicky
Betreff: [mapserver-users] Mapserver ogc:Filter fails
against Geoserver WFS
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:PropertyNameSTUPE
N/ogc:PropertyNameogc:Literal3/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=GetFeatureVE
RSION=1.0.0SERVICE=WFSTYPENAME=ccss:Flood2010_FloodActivityG
radeFILTER=ogc:Filterogc:PropertyIsEqualTo+xmlns:ogc=http://www.opengis.net/ogc;og
c:PropertyNameSTUPEN/ogc:PropertyNameogc:Literal3/ogc:Li
teral/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=GetFeatu
reVERSION=1.0.0SERVICE=WFSTYPENAME=okresyFILTER=ogc:Filte
rogc:PropertyIsLessThan+xmlns:ogc=http://www.opengis.net/ogc;ogc:PropertyName
KODOK/ogc:PropertyNameogc:Literal3555/ogc:Literal/ogc:P
ropertyIsLessThan/ogc:Filter
But Geoserver is not that tolerant...
[1] http://mapserver.org/ogc/filter_encoding.html
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users