GetFeature

The Web Feature Service (WFS) is able to service a request to retrieve feature instances. In addition, the client is able to specify which feature properties to fetch and is able to constrain the query spatially and non-spatially. The service can return the search results of a feature (content) based on the description returned in the DescribeFeatureType request.

An application applies filters to retrieve a specific set of features that satisfy the condition specified by the filter. For example, to get the various attributes, geographic or otherwise. Filters also let customers select a set of features for analysis, such as all the water features within a region or a new housing development (a custom polygon).

The GetFeature operation retrieves features and specified information about the feature from the Web Feature Service (WFS) server. An XML document that contains the result set is returned to the client.

POST Request

The XML encoding of a GetFeature request is defined by the following XML Schema fragment for WFS 1.1.0:


<xsd:elementname="GetFeature" type="wfs:GetFeatureType"/>
<xsd:complexType name="GetFeatureType">
    <xsd:sequence>
        <xsd:elementref="wfs:Query" maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attributename="version" type="xsd:string" use="required" fixed="1.1.0"/>
    <xsd:attributename="service" type="xsd:string" use="required" fixed="WFS"/>
    <xsd:attributename="handle" type="xsd:string" use="optional"/>
    <xsd:attributename="outputFormat" type="xsd:string" use="optional" default="text/xml; subtype=gml/3.1.1"/>
    <xsd:attributename="maxFeatures" type="xsd:positiveInteger" use="optional"/>
</xsd:complexType>
<xsd:elementname="Query" type="wfs:QueryType"/>
<xsd:complexType name="QueryType">
    <xsd:sequence>
        <xsd:elementref="ogc:PropertyName" minOccurs="0" maxOccurs="unbounded"/>
        <xsd:elementref="ogc:Filter" minOccurs="0" maxOccurs="1"/>
    </xsd:sequence>
    <xsd:attributename="handle" type="xsd:string" use="optional"/>
    <xsd:attributename="srsName" type="xsd:anyURI " use="optional"/>
    <xsd:attributename="typeName" type="xsd:QName" use="required"/>
    <xsd:attributename="featureVersion" type="xsd:string" use="optional"/>
</xsd:complexType>

The XML encoding of a GetFeature request is defined by the following XML Schema fragment for WFS 1.0.0:


<xsd:elementname="GetFeature" type="wfs:GetFeatureType"/>
<xsd:complexType name="GetFeatureType">
    <xsd:sequence>
        <xsd:elementref="wfs:Query" maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attributename="version" type="xsd:string" use="required" fixed="1.0.0"/>
    <xsd:attributename="service" type="xsd:string" use="required" fixed="WFS"/>
    <xsd:attributename="handle" type="xsd:string" use="optional"/>
    <xsd:attributename="outputFormat" type="xsd:string" use="optional" default="xmlschema"/>
    <xsd:attributename="maxFeatures" type="xsd:positiveInteger" use="optional"/>
</xsd:complexType>
<xsd:elementname="Query" type="wfs:QueryType"/>
<xsd:complexType name="QueryType">
    <xsd:sequence>
        <xsd:elementref="ogc:PropertyName" minOccurs="0" maxOccurs="unbounded"/>
        <xsd:elementref="ogc:Filter" minOccurs="0" maxOccurs="1"/>
    </xsd:sequence>
    <xsd:attributename="handle" type="xsd:string" use="optional"/>
    <xsd:attributename="srsName" type="xsd:anyURI " use="optional"/>
    <xsd:attributename="typeName" type="xsd:QName" use="required"/>
    <xsd:attributename="featureVersion" type="xsd:string" use="optional"/>
</xsd:complexType>

GET Request

The GET request contains the following:

Input Required Description
SERVICE=WFS Yes Fixed to WFS.
VERSION=1.1.0 Yes Fixed to 1.1.0. This is the version of the Web Feature Service standard implemented in this release. Regardless of the value specified, the service defaults to 1.1.0.
REQUEST=GetFeature Yes Set to GetFeature for a get feature operation.
TYPENAME Yes A comma-separated list of feature types.
MAXFEATURES No The maximum number of features to return.
OUTPUTFORMAT No

For 1.0.0, the default value is xmlschema

For 1.1.0, the default value is text/xml; subtype=gml/3.1.1.

For example:


http://<server>:<port>/rest/Spatial/WFS?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=World&MAXFEATURES=10