GetFeature Request

Feedback


Request parameters

Parameters for the GetFeature operation are listed in the following table.

Table 1 Parameters for GetFeature Operation

Request parameters Required/Optional Description

VERSION

Mandatory

Request version numbers.

Request WFS 2.0.0 service. The request version number needs to be set to 2.0.0.

SERVICE

Mandatory

Service type.

Request WFS 2.0.0 service. The request type needs to be set to WFS.

REQUEST

Mandatory

Request names.

Request GetFeature operation. The request name needs to be set to "GetFeature".

NAMESPACES

Optional

Namespace.

Used to specify namespaces and their prefixes. The format shall be xmlns(prefix,escaped_url). If the prefix is not specified then the default namespace shall be assumed. More that one namespace may be bound by specifying a comma separated list of xmlns() values.

VSPs

Optional

Vendor-specific parameter.

A server may implement additional KVP parameters that are not part of this International Standard. These are known as vendor-specific parameters. VSPs allow vendors to specify additional parameters that will enhance the results of requests. A server shall produce valid results even if the VSPs are missing, malformed or if VSPs are supplied that are not known to the server. Unknown VSPs shall be ignored.

A server may choose not to advertise some or all of its VSPs. If VSPs are included in the Capabilities XML, the ows:ExtendedCapabilities element shall be extended accordingly. Additional schema documents may be imported containing the extension(s) of the ows:ExtendedCapabilities element. Any advertised VSP shall include or reference additional metadata describing its meaning. WFS implementers should choose VSP names with care to avoid clashes with WFS parameters defined in this International Standard.

Currently, SuperMap iServer doesn't support this parameter.

STARTINDEX

Optional

Start index.

The index that the specified result set appears in the response document.

COUNT

Optional

The account returned.

The feature account contained in the specified result returned.

OUTPUTFORMAT

Optional

The encoding format of the response result.

When the GetFeature is defined, the default value of the encoding format is "application/gml+xml; version=3.2". This default value indicates that the response resource listed in the document employs the GMLS 3.2 encoding.  

RESULTTYPE

Optional

The return type.

A WFS can respond to a query operation in one of two ways (excluding an exception response). It may either generate a complete response document containing resources that satisfy the operation or it may simply generate an empty response container that indicates the count of the total number of resources that the operation would return. Which of these two responses a WFS generates is determined by the value of the optional resultType parameter. The possible values for this parameter are "results" and "hits". If the value of the resultType parameter is set to "results" the server shall generate a complete response document containing resources that satisfy the operation. If the value of the resultType attribute is set to "hits" the server shall generate an empty response document containing no resource instances and the root element of the response container shall contain the count of the total number of resources that the operation found.

RESOLVE

Optional

Resource reference.

The optional resolve parameter controls whether and which resource references are resolved by an operation. The value domain of the resolve parameter is: "local", "remote", "all" or "none". Values supported by the RESOLVE parameter of WFS 2.0.0 service are declared in the capabilties XML document.

Currently, SuperMap iServer doesn't support this parameter.

RESOLVEDEPTH

Optional

The depth to which nested resource references shall be resolved in a response document.

The resolveDepth parameter indicates the depth to which nested resource references shall be resolved in a response document. The range of valid values for this parameter consists of non-negative integers plus "*". If a value is not specified for the resolve parameter or if the value of the resolve parameter is set to "none", the server shall ignore any value specified for the resolveDepth parameter.

Currently, SuperMap iServer doesn't support this parameter.

RESOLVETIMEOUT

Optional

The resource parsing time.

The optional resolveTimeout parameter controls how long a server shall wait to receive a response when resolving resource references. If the value of the resolve parameter is set to "none", the server shall ignore any value specified for the resolveTimeout parameter.

Currently, SuperMap iServer doesn't support this parameter.

Adhoc Query Keywords

-

For specific parameters in Adhoc Query Keywords, please refer to Table 2.
Adhoc Query Keywords and Stored Query Keywords are exclusive.
Stored Query Keywords

-

For specific parameters in Stored Query Keywords, please refer to Table 4.
Adhoc Query Keywords and Adhoc Query Keywords are exclusive.

KVP encoding request parameters contained by Adhoc Query Keywords are listed in table below:

Table 2 Parameters in Adhoc Query Keywords

Request parameters Required/Optional Description

TYPENAMES

Mandatory

A list of feature types upon which to apply the operation.

The typeNames parameter lists multiple feature types. And the feature types are separated with comma.

The TYPENAMES parameter is mandatory in all cases except when the RESOURCEID parameter is specified.

ALIASES

Optional

Feature type alias.

The aliases parameter may be used within a query expression to specify a list of alternate names for the feature type names specified as the value of the typeNames parameter. A feature type alias may be used anywhere the feature type name may be used within the context of a query expression. The usage of feature type alias is shown as follows:

TYPENAMES=(ns1:FeatureType1,ns2:FeatureType2)(ns2:FeatureType2,ns2:FeatureType3)&ALIASES=(A,B)(C,D)

Currently, SuperMap iServer doesn't support this parameter.

SRSNAME

Optional

Coordinate reference system name.

Types of CRS transformation applicable to geometric features can be determined according to SRSNAME attribute value in the response document. The value of the srsName parameter may be the DefaultCRS or any of the OtherCRS values listed for the feature type in a server's capabilities document. If no srsName value is supplied, then the compatible feature geometries shall be encoded in the response document using the advertised DefaultCRS value.

Currently, SuperMap iServer doesn't support this parameter.

Projection clause

-

For parameters in projection clause, please refer to Table 3.

FILTER

Optional

Filter expression.

The filter expression of the language encoding specified by the FILTER_LANGUAGE parameter.

This parameter is exclusive with BBOX and RESOURCEID.

Please refer to FILTER Example.

FILTER_LANGUAGE

Optional

The encoding language of the filter expression.

Indicates the predicate language used to encode the filter expression that is the value of the FILTER parameter. The default value urn:ogc:def:query Language:OGC-FES:Filter shall be used to indicate that the value of FILTER parameter is a string encoding the filter using an XML fragment as defined in this International Standard.

Currently, SuperMap iServer doesn't support this parameter.

RESOURCEID

Optional

Resource identifier.

A comma-separated list of resource identifiers to retrieve from some data store.

This parameter is exclusive with BBOX and FILTER.

BBOX

Optional

BoundingBox.

This parameter is exclusive with RESOURCEID and FILTER.

Please refer to Bounding box.

SORTBY

Optional

How the attributes are sorted.

The SORTBY parameter is used to specify how attributes should be ordered. ASC are used to indicate an ascending sort and the letters DESC are used to indicate a descending sort. If neither ASC nor DESC are specified, the default sort order shall be ascending.

An example value might be: “SORTBY=Field1 DESC,Field2 DESC,Field3? In this case the results are sorted by Field 1 descending, Field2 descending and Field3 ascending.

KVP encoding request parameters contained by Projection clause are listed in table below:

Table 3 Request parameters in Projection clause

Request parameters Required/Optional Description

PROPERTYNAME

Optional

List of attribute names.

Represents optional attribute list contained in the response. If more than one feature type name is specified as the value of the TYPENAMES keyword, a list of parameter lists shall be specified.

RESOLVE

Optional

Resource reference.

The optional resolve parameter controls whether and which resource references are resolved by an operation. The value domain of the resolve parameter is: "local", "remote", "all" or "none". Values supported by the RESOLVE parameter of WFS 2.0.0 service are declared in the capabilties XML document.

Currently, SuperMap iServer doesn't support this parameter.

RESOLVEDEPTH

Optional

The depth to which nested resource references shall be resolved in a response document.

The resolveDepth parameter indicates the depth to which nested resource references shall be resolved in a response document. The range of valid values for this parameter consists of non-negative integers plus "*". If a value is not specified for the resolve parameter or if the value of the resolve parameter is set to "none", the server shall ignore any value specified for the resolveDepth parameter.

Currently, SuperMap iServer doesn't support this parameter.

RESOLVETIMEOUT

Optional

The resource parsing time.

The optional resolveTimeout parameter controls how long a server shall wait to receive a response when resolving resource references. If the value of the resolve parameter is set to "none", the server shall ignore any value specified for the resolveTimeout parameter.

Currently, SuperMap iServer doesn't support this parameter.

KVP encoding request parameters contained by Stored Query Keywords are listed in table below:

Table 4 Parameters in Stored Query Keywords

Request parameters Required/Optional Description

STOREDQUERY_ID

Mandatory

The stored query identifier.

SuperMap iServer only provides GetFeatureById, the identifier of which is urn:ogc:def:query:OGC-WFS::GetFeatureById.

STOREDQUERY_PARAMETER

Optional

The stored query parameter.

Each parameter of a stored query shall be encoded in KVP as a keyword-value pair. Stored query parameters shall not have names that conflict with any WFS parameter name.

Request example

GetFeature operation supports two query methods including Query and StoredQuery.

1. Sample for Query request

<ServiceRoot>?SERVICE=WFS&VERSION=version&REQUEST=GetFeature&TYPENAMES=type_list&FILTER=filter

ServiceRoot is the URI root directory of service and refer to the URI setting of service

For instance, when SuperMap iServer WFS 2.0.0 service starts successfully at local computer, the URI to access GetFeature operation is: http://localhost:8090/iserver/services/data-world/wfs200?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAMES=World:Capitals&FILTER=<fes:Filter><fes:And><fes:PropertyIsEqualTo><fes:ValueReference>World:COUNTRY</fes:ValueReference><fes:Literal>The United States</fes:Literal></fes:PropertyIsEqualTo><fes:PropertyIsEqualTo><fes:ValueReference>World:CAPITAL</fes:ValueReference><fes:Literal>Washington</fes:Literal></fes:PropertyIsEqualTo></fes:And></fes:Filter>

Please refer to Response example to see the result.

that is, executing Post request for http://localhost:8090/iserver/services/data-world/wfs200, the body is as follows:

<?xml version="1.0"?>

<wfs:GetFeature service="WFS" version="2.0.0"

    valueReference="World:CAPITAL" outputFormat="application/gml+xml; version=3.2"

    xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:fes="http://www.opengis.net/fes/2.0"

    xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xsi:schemaLocation="http://www.opengis.net/wfs/2.0

                       http://schemas.opengis.net/wfs/2.0.0/wfs.xsd

                       http://www.opengis.net/gml/3.2

                       http://schemas.opengis.net/gml/3.2.1/gml.xsd">

    <wfs:Query typeNames="World:Capitals">

        <fes:Filter>

            <fes:And>

                <fes:PropertyIsEqualTo>

                    <fes:ValueReference>World:COUNTRY</fes:ValueReference>

                    <fes:Literal>The United States</fes:Literal>

                </fes:PropertyIsEqualTo>

                <fes:PropertyIsEqualTo>

                    <fes:ValueReference>World:CAPITAL</fes:ValueReference>

                    <fes:Literal>Washington</fes:Literal>

                </fes:PropertyIsEqualTo>

            </fes:And>

        </fes:Filter>

    </wfs:Query>

</wfs:GetPropertyValue>

The respose result of this example is the same as KVP, please refer to Response example.

2. Sample for StoredQuery request

<ServiceRoot>?SERVICE=WFS&VERSION=version&REQUEST=GetFeature&STOREDQUERY_ID=storedquery_id&STOREDQUERY_PARAMETER=storedquery_parameter

ServiceRoot is the URI root directory of service and refer to the URI setting of service

For example, when the SuperMap iServer WFS 2.0.0 server at local computer has been started successfully, the URI to access the GetFeature operation is: http://localhost:8090/iserver/services/data-world/wfs200?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&STOREDQUERY_ID=urn:ogc:def:query:OGC-WFS::GetFeatureById&ID=World.Capitals.8.

Please refer to Response example to see the result.

that is, executing Post request for  http://localhost:8090/iserver/services/data-world/wfs200, the body is as follows:

<?xml version="1.0"?>

<wfs:GetFeature service="WFS" version="2.0.0" count="10"

    startIndex="0" outputFormat="application/gml+xml; version=3.2"

    xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:fes="http://www.opengis.net/fes/2.0"

    xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xsi:schemaLocation="http://www.opengis.net/wfs/2.0

                       http://schemas.opengis.net/wfs/2.0.0/wfs.xsd

                       http://www.opengis.net/gml/3.2

                       http://schemas.opengis.net/gml/3.2.1/gml.xsd">

    <wfs:StoredQuery id="urn:ogc:def:query:OGC-WFS::GetFeatureById">

        <wfs:Parameter name="id">World.Capitals.8</wfs:Parameter>

    </wfs:StoredQuery>

</wfs:GetFeature>

The respose result of this example is the same as KVP, please refer to Response example.