Spatial operator filters

The WFS Connector supports the spatial operator <BBOX>. This operator identifies all geometries that spatially interact with the bounding box constraints specified by a user. The XML encoding of <BBOX> is defined by the following XML schema fragment from the OGC Filter Encoding Implementation Specification:

<xsd:elementname="BBOX" type="ogc:BBOXType"substitutionGroup="ogc:spatialOps"/>
<xsd:complexTypename="SpatialOpsType"abstract="true"/>
<xsd:elementname="spatialOps"type="ogc:SpatialOpsType"abstract="true"/>
<xsd:complexTypename="BBOXType">
<xsd:complexContent>
<xsd:extensionbase="ogc:SpatialOpsType">
<xsd:sequence>
<xsd:elementref="ogc:PropertyName"/>
<xsd:elementref="gml:Box"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

If the optional <propertyName> element is not specified, the calling service must determine which spatial property is the spatial key and apply the BBOX operator accordingly.

Request options using <BBOX>

You can apply a <BBOX> operator 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.

Using <BBOX> in a GetFeature GET request

http://<hostname>/wfsconnector/com.esri.wfs.Esrimap/SantaClara_WFS?service=WFS&version=1.0.0&typename=sc_hospital-5&request=GetFeature&BBOX=-122.087210506228,37.208402,-121.813389493772,37.383473

where

<hostname> is the name of the machine on which the WFS service or test environment has been created.


Embedding Filter XML encoding 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:BBOX><ogc:PropertyName>gml:multiPointProperty</ogc:PropertyName><gml:Box%20xmlns="http://www.opengis.net/cite/spatialTestSuite"%20srsName="EPSG:4326"><gml:coordinates>-122.087210506228,%2037.208402,%20-121.813389493772,%2037.383473</gml:coordinates></gml:Box></ogc:BBOX></ogc:Filter>&typename=esri:sc_hospital-5&request=GetFeature

Using <BBOX> in 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_hospital-5">
<ogc:Filter>
<ogc:BBOX>
<ogc:PropertyName>gml:multiPointProperty</ogc:PropertyName>
<gml:Box xmlns="http://www.opengis.net/cite/spatialTestSuite" srsName="EPSG:4326">
<gml:coordinates>-122.087210506228, 37.208402, -121.813389493772, 37.383473</gml:coordinates>
</gml:Box>
</ogc:BBOX>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

Response

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

<?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://&tl;hostname>/wfsconnector/com.esri.wfs.Esrimap/SantaClara_WFS?request=describefeaturetype&amp;service=WFS&amp;version=1.0.0 http://www.opengis.net/wfs http://&tl;hostname>/wfsconnector/schema/wfs/1.0.0/WFS-basic.xsd">
<gml:boundedBy>
<gml:Box srsName="EPSG:4326">
<gml:coordinates> -122.087210506228,37.208402 -121.813389493772,37.383473</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<esri:sc_hospital-5 fid="sc_hospital-5.3">
<esri:name>
COMMUNITY HOSP LOS GATOS-SARAT
</esri:name>
<esri:fcc>
D31
</esri:fcc>
<gml:multiPointProperty>
<gml:MultiPoint srsName="EPSG:4326">
<gml:pointMember>
<gml:Point srsName="EPSG:4326">
<gml:coordinates>
-121.97238,37.264134
</gml:coordinates>
</gml:Point>
</gml:pointMember>
</gml:MultiPoint>
</gml:multiPointProperty>
</esri:sc_hospital-5>
</gml:featureMember>
<gml:featureMember>
<esri:sc_hospital-5 fid="sc_hospital-5.4">
<esri:name>
GOOD SAMARITAN HOSPITAL SANTA
</esri:name>
<esri:fcc>
D31
</esri:fcc>
<gml:multiPointProperty>
<gml:MultiPoint srsName="EPSG:4326">
<gml:pointMember>
<gml:Point srsName="EPSG:4326">
<gml:coordinates>
-121.949996,37.251507
</gml:coordinates>
</gml:Point>
</gml:pointMember>
</gml:MultiPoint>
</gml:multiPointProperty>
</esri:sc_hospital-5>
</gml:featureMember>
<gml:featureMember>
<esri:sc_hospital-5 fid="sc_hospital-5.5">
<esri:name>
KAISER FOUNDATION HOSPITAL
</esri:name>
<esri:fcc>
D31
</esri:fcc>
<gml:multiPointProperty>
<gml:MultiPoint srsName="EPSG:4326">
<gml:pointMember>
<gml:Point srsName="EPSG:4326">
<gml:coordinates>
-121.977846,37.342019
</gml:coordinates>
</gml:Point>
</gml:pointMember>
</gml:MultiPoint>
</gml:multiPointProperty>
</esri:sc_hospital-5>
</gml:featureMember>
<gml:featureMember>
<esri:sc_hospital-5 fid="sc_hospital-5.6">
<esri:name>
SANTA CLARA VALLEY MEDICAL CEN
</esri:name>
<esri:fcc>
D31
</esri:fcc>
<gml:multiPointProperty>
<gml:MultiPoint srsName="EPSG:4326">
<gml:pointMember>
<gml:Point srsName="EPSG:4326">
<gml:coordinates>
-121.932048,37.313392
</gml:coordinates>
</gml:Point>
</gml:pointMember>
</gml:MultiPoint>
</gml:multiPointProperty>
</esri:sc_hospital-5>
</gml:featureMember>
<gml:featureMember>
<esri:sc_hospital-5 fid="sc_hospital-5.7">
<esri:name>
O&apos;CONNOR HOSPITAL
</esri:name>
<esri:fcc>
D31
</esri:fcc>
<gml:multiPointProperty>
<gml:MultiPoint srsName="EPSG:4326">
<gml:pointMember>
<gml:Point srsName="EPSG:4326">
<gml:coordinates>
-121.937358,37.326935
</gml:coordinates>
</gml:Point>
</gml:pointMember>
</gml:MultiPoint>
</gml:multiPointProperty>
</esri:sc_hospital-5>
</gml:featureMember>
<gml:featureMember>
<esri:sc_hospital-5 fid="sc_hospital-5.8">
<esri:name>
EL CAMINO HOSPITAL
</esri:name>
<esri:fcc>
D31
</esri:fcc>
<gml:multiPointProperty>
<gml:MultiPoint srsName="EPSG:4326">
<gml:pointMember>
<gml:Point srsName="EPSG:4326">
<gml:coordinates>
-122.078112,37.367429
</gml:coordinates>
</gml:Point>
</gml:pointMember>
</gml:MultiPoint>
</gml:multiPointProperty>
</esri:sc_hospital-5>
</gml:featureMember>
<gml:featureMember>
<esri:sc_hospital-5 fid="sc_hospital-5.10">
<esri:name>
SAN JOSE MEDICAL CENTER
</esri:name>
<esri:fcc>
D31
</esri:fcc>
<gml:multiPointProperty>
<gml:MultiPoint srsName="EPSG:4326">
<gml:pointMember>
<gml:Point srsName="EPSG:4326">
<gml:coordinates>
-121.876814,37.342794
</gml:coordinates>
</gml:Point>
</gml:pointMember>
</gml:MultiPoint>
</gml:multiPointProperty>
</esri:sc_hospital-5>
</gml:featureMember>
<gml:featureMember>
<esri:sc_hospital-5 fid="sc_hospital-5.11">
<esri:name>
ALEXIAN BROTHERS HOSPITAL
</esri:name>
<esri:fcc>
D31
</esri:fcc>
<gml:multiPointProperty>
<gml:MultiPoint srsName="EPSG:4326">
<gml:pointMember>
<gml:Point srsName="EPSG:4326">
<gml:coordinates>
-121.848515,37.363291
</gml:coordinates>
</gml:Point>
</gml:pointMember>
</gml:MultiPoint>
</gml:multiPointProperty>
</esri:sc_hospital-5>
</gml:featureMember>
</wfs:FeatureCollection>