Comparison operator filters

A comparison operator is used to form expressions that evaluate the mathematical comparison between two arguments. If the arguments satisfy the comparison, the expression evaluates to TRUE. Otherwise, the expression evaluates to FALSE.

The WFS Connector supports the following <SimpleComparison> operations:

The XML encoding of these comparison operators is defined in the following XML schema fragment from the OGC Filter Encoding Implementation Specification.

<xsd:elementname="PropertyIsEqualTo" type="ogc:BinaryComparisonOpType"substitutionGroup="ogc:comparisonOps"/>
<xsd:elementname="PropertyIsNotEqualTo" type="ogc:BinaryComparisonOpType"substitutionGroup="ogc:comparisonOps"/>
<xsd:elementname="PropertyIsLessThan" type="ogc:BinaryComparisonOpType"substitutionGroup="ogc:comparisonOps"/>
<xsd:elementname="PropertyIsGreaterThan" type="ogc:BinaryComparisonOpType"substitutionGroup="ogc:comparisonOps"/>
<xsd:elementname="PropertyIsLessThanOrEqualTo" type="ogc:BinaryComparisonOpType"substitutionGroup="ogc:comparisonOps"/>
<xsd:elementname="PropertyIsGreaterThanOrEqualTo" type="ogc:BinaryComparisonOpType"substitutionGroup="ogc:comparisonOps"/>
<xsd:complexTypename="ComparisonOpsType"abstract="true"/>
<xsd:elementname="comparisonOps"type="ogc:ComparisonOpsType"abstract="true"/>
<xsd:complexTypename="BinaryComparisonOpType">
<xsd:complexContent>
<xsd:extensionbase="ogc:ComparisonOpsType">
<xsd:sequence>
<xsd:elementref="ogc:expression"minOccurs="2"maxOccurs="2"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

Request options for comparison operator filters

You can apply comparison operator filters using the following methods:

Regardless of the method used, the same information is returned in the response. The following are examples of each method. The examples use the SantaClara_WFS service.

Embedding a filter XML fragment in a GetFeature GET request

http://<hostname>/wfsconnector/com.esri.wfs.Esrimap/SantaClara_WFS? service=WFS&version=1.0.0& outputformat=GML2& filter=<ogc:Filter%20xmlns:ogc="http://www.opengis.net/ogc" %20xmlns:gml="http://www.opengis.net/gml" %20xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" %20xsi:schemaLocation="http://www.opengis.net/ogc/filter/1.0.0/filter.xsd %20http://www.opengis.net/gml/2.1/geometry.xsd"> <ogc:PropertyIsLessThanOrEqualTo> <ogc:PropertyName>length</ogc:PropertyName> <ogc:Literal>0.002</ogc:Literal> </ogc:PropertyIsLessThanOrEqualTo> </ogc:Filter>&typename=esri:sc_rivers-3&request=GetFeature

Issuing a GetFeature POST request

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:cgf="http://www.opengis.net/cite/geometry" outputFormat="GML2" version="1.0.0" service="WFS">
<wfs:Query typeName="esri:sc_rivers-4">
<ogc:Filter>
< ogc:PropertyIsLessThanOrEqualTo>
< ogc:PropertyName> length</ ogc:PropertyName>
< ogc:Literal>0.002</ ogc:Literal>
</ ogc:PropertyIsLessThanOrEqualTo>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

Response

The following response is from the GetFeature POST request (option 2).

<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:esri="http://www.esri.com/esri" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://www.esri.com/esri http://<hostname>/wfsconnector/com.esri.wfs.Esrimap/SantaClara_WFS?request=describefeaturetype&amp;service=WFS&amp;version=1.0.0 http://www.opengis.net/wfs http://<hostname>/wfsconnector/schema/wfs/1.0.0/WFS-basic.xsd">
<gml:boundedBy>
 <gml:Box srsName="EPSG:4326">
<gml:coordinates>
-122.202476848347,36.898188029149 -121.233339972444,37.484480967195
</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<esri:sc_rivers-4 fid="sc_rivers-4.43">
<esri:name>
BURCHELL
</esri:name>
<esri:fcc>
H10
</esri:fcc>
<esri:length>
0.00133
</esri:length>
<gml:multiLineStringProperty>
<gml:MultiLineString srsName="EPSG:4326">
<gml:lineStringMember>
<gml:LineString srsName="EPSG:4326">
<gml:coordinates>
-121.563688660252,37.0046853417482 -121.563665660252,37.0046913417482
</gml:coordinates>
</gml:LineString>
</gml:lineStringMember>
</gml:MultiLineString>
</gml:multiLineStringProperty>
</esri:sc_rivers-4>
</gml:featureMember>
<gml:featureMember>
<esri:sc_rivers-4 fid="sc_rivers-4.49">
<esri:name>
</esri:name>
<esri:fcc>
H10
</esri:fcc>
<esri:length>
0.00141
</esri:length>
<gml:multiLineStringProperty>
<gml:MultiLineString srsName="EPSG:4326">
<gml:lineStringMember>
<gml:LineString srsName="EPSG:4326">
<gml:coordinates>
-121.559833472748,37.0095420292527 -121.559808472748,37.0095470292527
</gml:coordinates>
</gml:LineString>
</gml:lineStringMember>
</gml:MultiLineString>
</gml:multiLineStringProperty>
</esri:sc_rivers-4>
</gml:featureMember>
<gml:featureMember>
<esri:sc_rivers-4 fid="sc_rivers-4.389">
<esri:name>
STEVENS CREEK
</esri:name>
<esri:fcc>
H11
</esri:fcc>
<esri:length>
0.00104
</esri:length>
<gml:multiLineStringProperty>
<gml:MultiLineString srsName="EPSG:4326">
<gml:lineStringMember>
<gml:LineString srsName="EPSG:4326">
<gml:coordinates>
-122.133753473283,37.2741320294991 -122.133753473283,37.2741470294991
</gml:coordinates>
</gml:LineString>
</gml:lineStringMember>
</gml:MultiLineString>
</gml:multiLineStringProperty>
</esri:sc_rivers-4>
</gml:featureMember>
<gml:featureMember>
<esri:sc_rivers-4 fid="sc_rivers-4.548">
<esri:name>
STEVENS CREEK
</esri:name>
<esri:fcc>
H11
</esri:fcc>
<esri:length>
0.00064
</esri:length>
<gml:multiLineStringProperty>
<gml:MultiLineString srsName="EPSG:4326">
<gml:lineStringMember>
<gml:LineString srsName="EPSG:4326">
<gml:coordinates>
-122.069378848223,37.3804367170981 -122.069380848223,37.3804277170981
</gml:coordinates>
</gml:LineString>
</gml:lineStringMember>
</gml:MultiLineString>
</gml:multiLineStringProperty>
</esri:sc_rivers-4>
</gml:featureMember>
<gml:featureMember>
<esri:sc_rivers-4 fid="sc_rivers-4.771">
<esri:name>
PENITENCIA CRK LOWER
</esri:name>
<esri:fcc>
H10
</esri:fcc>
<esri:length>
0.0006
</esri:length>
<gml:multiLineStringProperty>
<gml:MultiLineString srsName="EPSG:4326">
<gml:lineStringMember>
<gml:LineString srsName="EPSG:4326">
<gml:coordinates>
-121.919833973083,37.4540216546666 -121.919829973083,37.4540296546666
</gml:coordinates>
</gml:LineString>
</gml:lineStringMember>
</gml:MultiLineString>
</gml:multiLineStringProperty>
</esri:sc_rivers-4>
</gml:featureMember>
</wfs:FeatureCollection>