 | WFS GetCapabilities Operation
The WFS GetCapabilities request will return a document outlining:
- What operations (like GetFeature, Transaction, and LockFeature) the server support
- Where to send HTTP GET and POST requests
- A list of all the FeatureTypes (i.e. layers/datasets) the server has access to as well as:
- what operations (Query, Insert, Update, Delete, Lock) are available for that FeatureType
- the FeatureType name and namespace
- what SRS/Projection the data is in
- the spatial extents of the FeatureType
- what type of query functionality the server support
|
When to make a GetCapabilities request
Typically, the first request one makes to a server is GetCapabilities because it describes where to send the other request, what operations are supported, and what datasets (FeatureTypes) are available.
How to make a GetCapabilities request
The GetCapabilities request is extreamly simple.
Using HTTP GET:
Using HTTP POST:
<?xml version="1.0"?>
<wfs:GetCapabilities
service="WFS"
version="1.0.0"
xmlns:wfs="http:
xmlns:xsi="http:
xsi:schemaLocation="http:
/>
Format of a GetCapabilities response
The response is broken into four sections:
- The <Service> section with generic information about the server
- The <Capabilities> section with information about where to send HTTP GET and POST requests and the format of the response
- The <FeatureTypeList> with information about what operations are available for each FeatureType and some information about each FeatureType
- The <Filter_Capabilites> section which describes what kind of <ogc:Filter> Queries can be understood by the server.
The "<Service>" portion
The "<Service>" portion contains information about the server. From the WFS specification:
DESCRIPTION||
A name the service provider assigns to the web feature service instance. (required)|
The <Title> is a human-readable title to briefly identify this server in menus. (required)|
The <Abstract> is a descriptive narrative for more information about the server.|
The <Keyword> element contains short words to aid catalog searching.|
The <OnlineResource> element defines the top-level HTTP URL of this service. Typically the URL of a "home page" for the service. (required)|
The <Fees> element contains a text block indicating any fees imposed by the service provider for usage of the service or for data retrieved from the WFS. The keyword NONE is reserved to mean no fees.|
The <AccessConstraints> element constain a text block describing any access constraints imposed by the service provider on the WFS or data retrieved from that service. The keyword NONE is reserved to indicate no access constraints are imposed.|
...
<Service>
<Name>My GeoServer WFS</Name>
<Title>My GeoServer WFS</Title>
<Abstract>
This is a description of your Web Feature Server.
The GeoServer is a full transactional Web Feature Server, you may wish to limit
GeoServer to a Basic service level to prevent modificaiton of your geographic
data.
</Abstract>
<Keywords>WFS, WMS, GEOSERVER</Keywords>
<OnlineResource>http://geoserver.sourceforge.net/html/index.php</OnlineResource>
<Fees>NONE</Fees>
<AccessConstraints>NONE</AccessConstraints>
</Service>
...
The "<Capabilities>" portion
The Capabilities portion of the response contains information about which of the operations the service provides, where to sent HTTP GET and HTTP POST request, and what formats are supported.
| Service Name |
Information Provided |
| GetCapabilities |
(REQUIRED TO SUPPORT) Gives the location to send HTTP GET and POST requests |
| DescribeFeatureType |
(REQUIRED TO SUPPORT) Lists the formats supported (XMLSCHEMA - XSD - is required) and gives the location to send HTTP GET and POST requests. |
| GetFeature |
(REQUIRED TO SUPPORT) Lists the formats supported (GML2 - is required) and gives the location to send HTTP GET and POST requests. |
| Transaction |
(OPTIONAL TO SUPPORT) If the server supports insertion, deletion, or updating of features, this gives the location to send HTTP GET and POST requests. |
| LockFeature |
(OPTIONAL TO SUPPORT) If the server supports locking of features, this gives the location to send HTTP GET and POST requests. |
| GetFeatureWithLock |
(OPTIONAL TO SUPPORT) If the server supports locking of features, this gives the location to send HTTP GET and POST requests. |
 | Unsupported operations
If a server does not support an operation, it simply does not list it in the "<Capabilities>" section. |
...
<Capability>
<Request>
<GetCapabilities>
<DCPType>
<HTTP>
<Get onlineResource="http://localhost:8080/geoserver/wfs?"/>
</HTTP>
</DCPType>
<DCPType>
<HTTP>
<Post onlineResource="http://localhost:8080/geoserver/wfs?"/>
</HTTP>
</DCPType>
</GetCapabilities>
<DescribeFeatureType>
<SchemaDescriptionLanguage>
<XMLSCHEMA/>
</SchemaDescriptionLanguage>
<DCPType>
<HTTP>
<Get onlineResource="http://localhost:8080/geoserver/wfs?"/>
</HTTP>
</DCPType>
<DCPType>
<HTTP>
<Post onlineResource="http://localhost:8080/geoserver/wfs?"/>
</HTTP>
</DCPType>
</DescribeFeatureType>
<GetFeature>
<ResultFormat>
<GML2/>
</ResultFormat>
<DCPType>
<HTTP>
<Get onlineResource="http://localhost:8080/geoserver/wfs?"/>
</HTTP>
</DCPType>
<DCPType>
<HTTP>
<Post onlineResource="http://localhost:8080/geoserver/wfs?"/>
</HTTP>
</DCPType>
</GetFeature>
<Transaction>
<DCPType>
<HTTP>
<Get onlineResource="http://localhost:8080/geoserver/wfs?"/>
</HTTP>
</DCPType>
<DCPType>
<HTTP>
<Post onlineResource="http://localhost:8080/geoserver/wfs?"/>
</HTTP>
</DCPType>
</Transaction>
<LockFeature>
<DCPType>
<HTTP>
<Get onlineResource="http://localhost:8080/geoserver/wfs?"/>
</HTTP>
</DCPType>
<DCPType>
<HTTP>
<Post onlineResource="http://localhost:8080/geoserver/wfs?"/>
</HTTP>
</DCPType>
</LockFeature>
<GetFeatureWithLock>
<ResultFormat>
<GML2/>
</ResultFormat>
<DCPType>
<HTTP>
<Get onlineResource="http://localhost:8080/geoserver/wfs?"/>
</HTTP>
</DCPType>
<DCPType>
<HTTP>
<Post onlineResource="http://localhost:8080/geoserver/wfs?"/>
</HTTP>
</DCPType>
</GetFeatureWithLock>
</Request>
</Capability>
...
The "<FeatureTypeList>" portion
The "<FeatureTypeList>" portion defines (1) what operations the server supports for each of the FeatureTypes and (2) some information about each of the FeatureTypes.
 | What is a FeatureType?
A FeatureType is a a single concrete type of gml feature (as defined by an Application Schema .XSD). It is usually named with a "prefix:name" tag to uniquely identify it relative to other FeatureType names.
A FeatureType is often (but not always) synonymous with a dataset or layer. A dataset may contain multiple FeatureTypes - for example, the "City" dataset may contain "ny:Road" and "ny:Building" FeatureTypes. |
The basic format for the <FeatureTypeList> section is:
...
<FeatureTypeList>
<Operations>
..operations supported for ALL FeatureTypes ..
</Operations>
<FeatureType>
<Operations>
..operations supported for THIS particular FeatureType
</Operations>
... information about this FeatureType ...
<FeatureType>
... information about other FeatureTypes ...
</FeatureTypeList>
...
The WFS specification details how to say what operations are supported:
| NAME |
DESCRIPTION |
| Insert |
The <Insert> element is used to indicate that the WFS is capable of creating new instances of a feature type. |
| Update |
The <Update> element indicates that the WFS can change the existing state of a feature. |
| Delete |
The <Delete> element indicates that the WFS can delete or remove instances of a feature type from the datastore. |
| Query |
The <Query> element indicates that the WFS is capable of executing a query on a feature type. |
| Lock |
The <Lock> element indicates that the WFS is capable of locking instances of a feature |
It also details what information is available about each of the FeatureTypes:
| ELEMENT |
DESCRIPTION |
| Name |
The namespace qualified name of the feature type. This element is mandatory. |
| Title |
The <Title> is a human-readable title to briefly identify this feature type in menus. |
| Abstract |
The <Abstract> is a descriptive narrative for more information about the feature type. |
| Keyword |
The <Keyword> element contains short words to aid catalog searching. |
| SRS |
The <SRS> element is used to indicate which spatial reference system should be used to express the state of a feature. The SRS may be indicated using either the Petrotechnical Open Software Corporation form âEPSG:<POSC Code>â or the URL format. See Projections and Coordinate Reference Systems |
| Operations |
The <Operations> element defines which are operations are supported on a feature type. Any locally defined operations take precedence over any globally defined operations. |
| LatLongBoundingBox |
The LatLongBoundingBox element is used to indicate the edges of an enclosing rectangle in the SRS of the associated feature type. Its purpose is to facilitate geographic searches by indicating where instances of the particular feature type exist. Since multiple LatLongBoundingBoxes can be specified,a WFS can indicate where various clusters of data may exist. This knowledge aids client applications by letting them know where they should query in order to have a high probability of finding data. |
| MetadataURL |
A WFS may use zero or more <MetadataURL> elements to offer detailed, standardized metadata about the data in a particular feature type. The type attribute indicates the standard to which the metadata complies; the format attribute indicates how the metadata is structured. Two types are defined at present: 'TC211' = ISO TC211 19115; 'FGDC' = FGDC CSDGM. |
The following example details that "tiger:areaLandmarks" FeatureType supports all the operations (Query,Lock,Insert,Update, and Delete) and the "tiger:roads" only supports Query and Lock.
...
<FeatureTypeList>
<Operations>
<Query/>
<Lock/>
</Operations>
<FeatureType>
<Name>tiger:areaLandmarks</Name>
<Title>TIGER dataset area landmarks</Title>
<Abstract>Generated from tiger_ny</Abstract>
<Keywords>TIGER landmarks</Keywords>
<SRS>EPSG:32618</SRS>
<Operations>
<Insert/>
<Update/>
<Delete/>
</Operations>
<LatLongBoundingBox
minx="-74.01495134869995"
miny="40.701071117671454"
maxx="-73.93677168659703"
maxy="40.823589625670316"/>
</FeatureType>
<FeatureType>
<Name>tiger:roads</Name>
<Title>TIGER roads</Title>
<Abstract>Generated from tiger_ny</Abstract>
<Keywords>TIGER roads</Keywords>
<SRS>EPSG:4326</SRS>
<LatLongBoundingBox
minx="-74.0272216796875"
miny="40.6842193603516"
maxx="-73.9069976806641"
maxy="40.8781814575195"/>
</FeatureType>
</FeatureTypeList>
...
The "<Filter_Capabilties>" portion
The "<Filter_Capabilties>" portion details what kinds of Queries the server can support. There are two categories of functionality: Spatial (operations involving geometry and location) and Scalar (operations not involving geometries). The GetCapabilities lists the functionality the server can support. Querying data using 'Filter' fully describes these functions.
NOTE: A server is allowed to support custom functions - these are also listed in the response document.
...
<ogc:Filter_Capabilities>
<ogc:Spatial_Capabilities>
<ogc:Spatial_Operators>
<ogc:Disjoint/>
<ogc:Equals/>
<ogc:DWithin/>
<ogc:Beyond/>
<ogc:Intersect/>
<ogc:Touches/>
<ogc:Crosses/>
<ogc:Within/>
<ogc:Contains/>
<ogc:Overlaps/>
<ogc:BBOX/>
</ogc:Spatial_Operators>
</ogc:Spatial_Capabilities>
<ogc:Scalar_Capabilities>
<ogc:Logical_Operators/>
<ogc:Comparison_Operators>
<ogc:Simple_Comparisons/>
<ogc:Between/>
<ogc:Like/>
<ogc:NullCheck/>
</ogc:Comparison_Operators>
<ogc:Arithmetic_Operators>
<ogc:Simple_Arithmetic/>
</ogc:Arithmetic_Operators>
</ogc:Scalar_Capabilities>
</ogc:Filter_Capabilities>
The GetCapabilites response XSD Schema
The GetCapabilites response XSD Schema and the Filter_Capabilties XSD schema are attached to the bottom of this page.
<?xml version="1.0"?>
<wfs:GetCapabilities
service="WFS"
version="1.0.0"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd"
/>