How to filter WFS in ArcCatalog 9.3.1?

371
3
06-22-2011 06:29 AM
Highlighted
Occasional Contributor III
Hello,

I have access to a WFS service which contains a large number (250,000+) of features.  It takes a very long time to load into ArcMap and I'd like to be able to filter in the data for the end users as they will only want to see data specific to their program.  In version 10, there are options when creating the WFS connection parameters to a) set the Max # of Features & b) set a Filter in XML using the OGC comparison filters like this -


<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:PropertyIsEqualTo matchCase="false">
  <ogc:PropertyName>SURVEY_ID</ogc:PropertyName>
  <ogc:Literal>1234</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>


Is there a way to do this in 9.3.1?  There's a small textbox labeled 'filter' when you view the table list, but I've tried using the exact XML that works in v10 but I still get all the features.  Is this kind of functionality available in 9.3.1?  Most of our users will not be in v10 until this fall.

Thank you,

Terry
Reply
0 Kudos
3 Replies
Highlighted
Esri Regular Contributor
Hello Terry

Assuming you are hitting a WFS 1.1.0-capable server then you should be able to append the extra details to the Dataset (i.e. base URL) string.  if you are using English then the raw XML should be URL-compliant (my uneducated guess).  Something like:

http://wms.data.linz.govt.nz/secretkey/wfs?VERSION=1.1.0&MAXFEATURES=1234&FILTER=<Filter><And><PropertyIsEqualTo><PropertyName>affected_surveys</PropertyName><Literal>DP 327235</Literal></PropertyIsEqualTo><PropertyIsEqualTo><PropertyName>land_district</PropertyName><Literal>North Auckland</Literal></PropertyIsEqualTo></And></Filter>

As you can see I'm also dealing with national-scale data, creating FDL files for people to use to access just the data they want.

Regards
Reply
0 Kudos
Highlighted
by Anonymous User
Not applicable
Original User: gilest

Thanks for the tips Bruce, I'll give it a try.  Just need to get the encoding down for the filter and looks like it should work.
Reply
0 Kudos
Highlighted
Occasional Contributor III
I finally had time to go back and try this.  Bruce you were correct - only tweak I had to make was to qualify all of the filter tags with the ogc namespace, otherwise it would connect to the dataset but not filter.

https://someserver.agency.gov/service_WFS/MapServer/WFSServer?VERSION=1.1.0&FILTER=<ogc:Filter><ogc:PropertyIsEqualTo><ogc:PropertyName>SURVEY_ID</ogc:PropertyName><ogc:Literal>1234</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>


On a side note, I noticed the .fdl files created contain the user name and password as plain text, was hoping at least the password would be encrypted like in a SDE connection file.

Thanks again Bruce,

Terry
Reply
0 Kudos