GetFeature

The GetFeature operation allows retrieval of features from a Web Feature Service. An XML document containing the result set is returned to the client (OGC WFS Implementation Specification 2002).

A GetFeature request can be issued through both GTTP GET/KVP and GTTP POST/XML encodings.

The GetFeature element has an optional maxFeatures attribute that restricts the number of features to be retrieved. Without this attribute, all available features are retrieved. It is highly recommended to use maxFeatures. Otherwise, responses can become overly long, and some clients may not be able to properly parse the response.

GetFeature request parameters

Parameter Remarks
REQUEST (M) Name of WFS request type; must be GetFeature for a WFS GetFeature operation
SERVICE (M) Service type; must be WFS for all WFS operations
TYPENAME (M) A list of feature type names to query
BBOX (O) Used to limit the returned features in only those that are not disjoint with a bounding box defined by BBOX; mutually exclusive with FILTER and FEATUREID. TYPENAME is a prerequisite.
FEATUREID (O) A list of feature instances to be fetched by a WFS identified by the feature instances’ feature identifiers; mutually exclusive with FILTER and BBOX. >TYPENAME is a prerequisite
FILTER (O) A filter specification describes a set of features to operate upon. The filter is defined as specified in the OGC Filter Encoding Specification. If the FILTER parameter is used, one filter must be specified for each feature type listed in the TYPENAME parameter. Individual filters encoded in the FILTER parameter are enclosed in parentheses "("and")". TYPENAME is a prerequisite.
MAXFEATURES (O) A positive integer indicating the maximum number of features that should be returned by a WFS to a request.
OUTPUTFORMAT (O) The output format used to describe feature data returned by WFS; the default value is GML2.
PROPERTYNAME (O) A list of properties may be specified for each feature type that is being queried. (Refer to the OGC WFS Specification Section 13.2.2 on how to form lists of parameters).

A 1:1 relationship exists between each element in a FEATUREID or TYPENAME list and the PROPERTYNAME list. The absence of a value indicates that all properties should be fetched.

VERSION (O) Request version number; the WFS Connector supports only WFS version 1.0.0

Note: Parameters marked with M are mandatory, and those with O are optional.

GetFeature request POST encoding XML schema

The XML encoding for GetFeature is defined in the following XML schema fragment from the OGC Filter Encoding Implementation Specification.

<xsd:element name="GetFeature" type="wfs:GetFeatureType"/>
<xsd:complexType name="GetFeatureType">
<xsd:sequence>
<xsd:element ref="wfs:Query" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="version" type="xsd:string" use="required" fixed="1.0.0"/>
<xsd:attribute name="service" type="xsd:string" use="required" fixed="WFS"/>
<xsd:attribute name="handle" type="xsd:string" use="optional"/>
<xsd:attribute name="outputFormat" type="xsd:string" use="optional" default="GML2"/>
<xsd:attribute name="maxFeatures" type="xsd:positiveInteger" use="optional"/>
</xsd:complexType>

<xsd:element name="Query" type="wfs:QueryType"/>
<xsd:complexType name="QueryType">
<xsd:sequence>
<xsd:element ref="ogc:PropertyName" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="ogc:Filter" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="handle" type="xsd:string" use="optional"/>
<xsd:attribute name="typeName" type="xsd:QName" use="required"/>
<xsd:attribute name="featureVersion" type="xsd:string" use="optional"/>
</xsd:complexType>

GetFeature request options

You can send a GetFeature request using the following methods:

The following examples use the SantaClara_WFS service.

Issuing a GetFeature GET request

http://<host_name>/wfsconnector/com.esri.wfs.Esrimap/SantaClara_WFS?request=getfeature&typename=sc_cities-6&service=wfs&version=1.0.0

where

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


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_cities-6">
</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.143890380859,37.0058860778809 -121.569290161133,37.441837310791
</gml:coordinates>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<esri:sc_cities-6 fid="sc_cities-6.1">
<esri:feature>
Population 10,000 to 49,000
</esri:feature>
<esri:name>
Campbell
</esri:name>
<esri:fips55>
10340
</esri:fips55>
<esri:pop>
36048
</esri:pop>
<esri:fips>
06085506503
</esri:fips>
<gml:multiPointProperty>
<gml:MultiPoint srsName="EPSG:4326">
<gml:pointMember>
<gml:Point srsName="EPSG:4326">
<gml:coordinates>
-121.950904846191,37.2871742248535
</gml:coordinates>
</gml:Point>
</gml:pointMember>
</gml:MultiPoint>
</gml:multiPointProperty>
</esri:sc_cities-6>
</gml:featureMember>

  [...]

</wfs:FeatureCollection>


Search code: @get_feature_wfs