[mapserver-users] How to filter ArcGIS WFS service?

Miloslav Kmeť miloslav.kmet at gmail.com
Thu Apr 1 07:57:35 EDT 2010


Hello.

I need to find a solution how to filter ArcGIS wfs service in mapserver WFS 
client. I read this document: http://mapserver.org/ogc/filter_encoding.html and 
there is no topic about xml ns prefixes in filter.

It seems, that esri's wfs services need xml namespace ogc: in every filter 
element.

I tried id with get from browser and this works as expected:
<ogc:Filter><ogc:PropertyIsEqualTo><ogc:PropertyName>eia_eia:IDAKCIA</ogc:PropertyName><ogc:Literal>1833</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>
?service=wfs&version=1.1.0&request=getFeature&typename=eia_eia:EIA_Locality&filter=%3Cogc:Filter%3E%3Cogc:PropertyIsEqualTo%3E%3Cogc:PropertyName%3Eeia_eia:IDAKCIA%3C/ogc:PropertyName%3E%3Cogc:Literal%3E1833%3C/ogc:Literal%3E%3C/ogc:PropertyIsEqualTo%3E%3C/ogc:Filter%3E
(tinyurlized: http://tinyurl.com/yanqfry)

But this won't filter anything and gives me all features:
<Filter><PropertyIsEqualTo><PropertyName>eia_eia:IDAKCIA</PropertyName><Literal>1833</Literal></PropertyIsEqualTo></Filter>
?service=wfs&version=1.1.0&request=getFeature&typename=eia_eia:EIA_Locality&filter=%3CFilter%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Eeia_eia:IDAKCIA%3C/PropertyName%3E%3CLiteral%3E1833%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E
(tinyurlized: http://tinyurl.com/y9t3rld)

I doubt, that I can get some response from Esri on this topic, because of this 
thread: http://forums.esri.com/Thread.asp?c=158&f=2276&t=273488 where folks

So the question is - how to add the ogc: namespace prefix into wfs_filter?

This is how I have configured the WFS in my mapfile:
    CONNECTIONTYPE WFS
    CONNECTION 
"http://globus.sazp.sk/arcgis/services/eia/eia/mapserver/wfsserver"
    
    METADATA
      "wfs_version" "1.0.0"
      "wfs_service" "WFS"
      "wfs_request_method" "GET"
      "wfs_srs" "EPSG:4326"
      "wfs_typename" "eia_eia:EIA_locality"
      "wfs_filter" 
"<PropertyIsEqualTo><PropertyName>eia_eia:IDAKCIA</PropertyName><Literal>1833</Literal></PropertyIsEqualTo>"
      "wfs_maxfeatures" "1000"
    END

Thank you.

-- 
Miloslav Kmeť


More information about the mapserver-users mailing list