WFS filter issue

588
1
09-09-2011 01:02 PM
TerryGiles
Occasional Contributor III
Hi all,

I posted this on the ArcGIS general forum a month ago but never got any response.  Hopefully someone more familiar with Data Interop than I am can help me resolve my issue.

I've set up an Interop connection to a WFS service and am seeing odd behavior when applying a filter. Basically what I need to do if filter the data to multiple states for a given survey type. Bascially an expression like this -
(state_code = "MT" or state_code = "SD" or state_code = "ND" or state_code = "NE" ) AND (survey = "type1")


I can get the filter to work when I only provide 2 states but when I try to put 3 states in the OR statement I get the usual error stating "The dataset appears to be invalid. Please verify your settings ... and try again".

Am I writing the OR statement incorrectly or is this a known issue with either ArcGIS or the WFS standards? The 2 versions of the filters are below & I'm using ArcGIS v10.0

Thanks, Terry

2 states only - works

<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
 <ogc:And>
  <ogc:Or>
   <ogc:PropertyIsEqualTo>
    <ogc:PropertyName>STATE_CODE</ogc:PropertyName>
    <ogc:Literal>NE</ogc:Literal>
   </ogc:PropertyIsEqualTo>
   <ogc:PropertyIsEqualTo>
    <ogc:PropertyName>STATE_CODE</ogc:PropertyName>
    <ogc:Literal>MT</ogc:Literal>
   </ogc:PropertyIsEqualTo>
  </ogc:Or>
  <ogc:PropertyIsEqualTo>
   <ogc:PropertyName>SURVEY_NAME</ogc:PropertyName>
   <ogc:Literal>Type1</ogc:Literal>
  </ogc:PropertyIsEqualTo>
 </ogc:And>
</ogc:Filter>

3 states in the OR - fails
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
 <ogc:And>
  <ogc:Or>
   <ogc:PropertyIsEqualTo>
    <ogc:PropertyName>STATE_CODE</ogc:PropertyName>
    <ogc:Literal>NE</ogc:Literal>
   </ogc:PropertyIsEqualTo>
   <ogc:PropertyIsEqualTo>
    <ogc:PropertyName>STATE_CODE</ogc:PropertyName>
    <ogc:Literal>MT</ogc:Literal>
   </ogc:PropertyIsEqualTo>
   <ogc:PropertyIsEqualTo>
    <ogc:PropertyName>STATE_CODE</ogc:PropertyName>
    <ogc:Literal>WY</ogc:Literal>
   </ogc:PropertyIsEqualTo>
  </ogc:Or>
  <ogc:PropertyIsEqualTo>
   <ogc:PropertyName>SURVEY_NAME</ogc:PropertyName>
   <ogc:Literal>Type1</ogc:Literal>
  </ogc:PropertyIsEqualTo>
 </ogc:And>
</ogc:Filter>

0 Kudos
1 Reply
MitaHajirakar
New Contributor
Hi Terry,

Not sure that I can offer too much here, but I think the issue is probably on the WFS Server end.  Since your filter works with 2 conditions it should also work with 3.  The Data Interoperability WFS client is simply transferring whatever is being typed to the WFS Server.

Kind regards,
Mita Hajirakar
Safe Software, Inc.
0 Kudos