64
Copyright © 2010 Open Geospatial Consortium
11 GetFeature operation
11.1 Introduction
The GetFeature operation returns a selection of features from a data store. A WFS processes a GetFeature request and returns a response document to the client that contains zero or more feature instances that
satisfy the query expressions specified in the request.
The canonical representation of features uses GML see ISO 19136:2007, and the form of the GetFeature request is modelled after this representation of the result set. For this reason, it is necessary to have a clear
understanding of how the General Feature Model see ISO 19109 is mapped into the GML representation. The reference description of GML is given by ISO 19136:2007 but the salient aspects are summarized here.
In GML a feature is represented as an XML element. The name of the feature element indicates the Feature Type, conventionally given in UpperCamelCase see OGC 06-121r3:2009, 11.6.2, such as xmml:BoreHole
or myns:SecondaryCollege.
The content of a feature element is a set of elements that describes the feature in terms of a set of properties. Each child element of the feature element is a property. The name of the property indicates what the property
means, conventionally given in lowerCamelCase see OGC 06-121r3:2009, 11.6.2, such as gml:boundedBy
or xmml:collarLocation. The value of a property is given in-line by the content of the property element, or by-reference as the value of
a resource identified in a link carried as an XML attribute of the property element. If the in-line form is used, then the content may be a literal a number, text, etc, or may be structured using XML elements, but no
assumptions can be made about the structure of the value of a property. In some cases the value of a property of feature may be another feature, for example a myns:School feature may have a property
myns:frontsOn
, whose value is a myns:Road, which will itself have further properties, etc.
11.2 Request 11.2.1 Request Semantics
Figure 17 describes the schema of a GetFeature request.
Copyright © 2010 Open Geospatial Consortium
65
Bas eRequest + service : CharacterString = WFS {frozen}
+ version : CharacterString = 2.0.0 {frozen} + handle [0..1] : CharacterString
GetFeature + query [1. .] : QueryE xpression
Result Type + results
+ hits Enumeration
StandardResolveParameters + resolve : ResolveValue = none
+ resolveDepth : UnlimitedInteger = isInfinite + resolveTimeout : TM_Duration = 300s
ResolveValue + local
+ remote + all
+ none Enumeration
StandardPresentationParameters + resultType : ResultType = results
+ outputFormat : CharacterString = text xml; subtype=gml3.2 + count [0..1] : Integer
+ startIndex : Integer = 0 {resolveDepth0 implies
resolvenone and resolveTimeout-notEmpty
implies resolvenone}
ResolveWithPath + resolvePath [0..1] : CharacterString
Figure 17 — GetFeature request 11.2.2 XML encoding
The XML encoding of a GetFeature request is defined by the following XML Schema fragment:
xsd:element name=GetFeature type=wfs:GetFeatureType xsd:complexType name=GetFeatureType
xsd:complexContent xsd:extension base=wfs:BaseRequestType
xsd:sequence xsd:element ref=fes:AbstractQueryExpression
maxOccurs=unbounded xsd:sequence
xsd:attributeGroup ref=wfs:StandardPresentationParameters xsd:attributeGroup ref=wfs:StandardResolveParameters
xsd:extension xsd:complexContent
xsd:complexType
A GetFeature request contains one or more query expressions. A query expression identifies a set of feature instances that shall be presented to a client in the response document. Query expressions in a GetFeature
request shall independent on each other and may be executed in any order. The response collections, however, shall be presented in the order in which the query expressions are encountered in a GetFeature
request.
11.2.3 KVP encoding
Table 17 defines the KVP-encoding for a GetFeature request.