WFS - Web Feature Service Development Guide

The Web Feature Service (WFS) represents a change in the way geographic information is created, modified and exchanged on the Internet. Rather than sharing geographic information at the file level using File Transfer Protocol (FTP), for example, the WFS offers direct fine-grained access to geographic information at the feature and feature property level.

WFS GetCapabilities request.

A request which returns a service metadata document (XML) describing the WFS service as well as valid operations and parameters provided by a single map file.

Required parameters:

project: name of directory where mapfile exists
map: name of mapfile to be used in request
service: name of protocol (WFS)
request: name of Maptimus 2 service operation (GetCapabilities)

Optional parameters:

version: protocol (WFS) version number (1.0.0, 2.0.0)
format: output format of the response to a GetCapabilities operation

URL example:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=GetCapabilities

Output example :

<?xml version="1.0" encoding="UTF-8"?>
<wfs:WFS_Capabilities xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:ms="http://mapserver.gis.umn.edu/mapserver" xmlns="http://www.opengis.net/wfs/2.0" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd">
    <ows:ServiceIdentification>
        <ows:Title>OSM Features</ows:Title>
        <ows:Abstract>A test OSM roads feature map.</ows:Abstract>

...

                <fes:TemporalOperator name="During"/>
            </fes:TemporalOperators>
        </fes:Temporal_Capabilities>
    </fes:Filter_Capabilities>
</wfs:WFS_Capabilities>

WFS GetFeature request.

A request which returns a selection of features from a data source including geometry and attribute values.

The following formats can be an output of the GetMap request:
XML (default)
CSV: outputformat=text/csv
GeoJSON: outputformat=application/json

Required parameters:

project: name of directory where mapfile exists
map: name of mapfile to be used in request
service: name of protocol (WFS)
request: name of Maptimus 2 service operation (GetFeature)
version: protocol (WFS) version number (1.0.0, 2.0.0)
query: query expression

Optional parameters:

outputFormat: output format of the response to a GetFeature operation
count: number of explicitly requested values
startIndex: index within the result set from which the server shall begin
presenting results
resulttype: complete or empty response result (hits or results)

URL example:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=GetFeature&typenames=test_roads&count=5

Output example :

<?xml version='1.0' encoding="UTF-8" ?>
<wfs:FeatureCollection
   xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
   xmlns:gml="http://www.opengis.net/gml/3.2"
   xmlns:wfs="http://www.opengis.net/wfs/2.0"

...

            <ms:access_type>yes</ms:access_type>
            <ms:service>none</ms:service>
        </ms:test_roads>
    </wfs:member>
</wfs:FeatureCollection>

WFS DescribeFeatureType request.

A request which returns a description of feature types supported by a specific WFS map file.

Required parameters:

project: name of directory where mapfile exists
map: name of mapfile to be used in request
service: name of protocol (WFS)
request: name of Maptimus 2 service operation (DescribeFeatureType)
version: protocol (WFS) version number (1.0.0, 2.0.0)
typename: comma separated list of feature types to describe

Optional parameters:

outputFormat: output format of the response to a DescribeFeatureType operation

URL example:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=DescribeFeatureType&typename=test_roads

Output example :

<?xml version='1.0' encoding="UTF-8" ?>
<schema
   targetNamespace="http://mapserver.gis.umn.edu/mapserver" 
   xmlns:ms="http://mapserver.gis.umn.edu/mapserver" 
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"

...

                </sequence>
            </extension>
        </complexContent>
    </complexType>
</schema>

WFS GetPropertyValue request.

A request which returns the value of a feature property from the data source for a set of features using a query.

Required parameters:

project: name of directory where mapfile exists
map: name of mapfile to be used in request
service: name of protocol (WFS)
request: name of Maptimus 2 service operation (GetPropertyValue)
version: protocol (WFS) version number (1.0.0, 2.0.0)
query: query expression
valuereference: XPath expression that identifies a node, or child node of a property node of a feature whose value shall be retrieved from a server's data store

Optional parameters:

count: number of explicitly requested values
startIndex: index within the result set from which the server shall begin
presenting results
resulttype: complete or empty response result (hits or results)
outputFormat: output format of the response to a GetPropertyValue operation
sortby: used to specify a list of property names whose values should be used to order (upon presentation) the set of feature instances that satisfy the query

URL example:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=GetPropertyValue&typenames=test_roads&valuereference=highway_type&sortby=highway_type ASC

Output example :

<?xml version='1.0' encoding="UTF-8" ?>
<wfs:ValueCollection
   xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
   xmlns:gml="http://www.opengis.net/gml/3.2"
   xmlns:wfs="http://www.opengis.net/wfs/2.0"

...

    </wfs:member>
    <wfs:member>
        <ms:highway_type>unclassified</ms:highway_type>
    </wfs:member>
</wfs:ValueCollection>

WFS ListStoredQueries request.

An operation which returns a metadata document listing the stored queries available on the server for a configured WFS map file.

Required parameters:

project: name of directory where mapfile exists
map: name of mapfile to be used in request
service: name of protocol (WFS)
request: name of Maptimus 2 service operation (ListStoredQueries)
version: protocol (WFS) version number (1.0.0, 2.0.0)

URL example:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=ListStoredQueries

Output example :

<?xml version="1.0" encoding="UTF-8"?>
<wfs:ListStoredQueriesResponse xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wfs/2.0" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd">
    <StoredQuery id="urn:ogc:def:query:OGC-WFS::GetFeatureById">
        <Title>Get feature by identifier</Title>
        <ReturnFeatureType xmlns:ms="http://mapserver.gis.umn.edu/mapserver">ms:test_roads</ReturnFeatureType>
    </StoredQuery>
</wfs:ListStoredQueriesResponse>

WFS DescribeStoredQueries request.

An operation which returns a metadata document describing the stored queries available on the server for a configured WFS map file.

Required parameters:

project: name of directory where mapfile exists
map: name of mapfile to be used in request
service: name of protocol (WFS)
request: name of Maptimus 2 service operation (DescribeStoredQueries)
version: protocol (WFS) version number (1.0.0, 2.0.0)
storedquery_id: identifier of the stored query to invoke

URL example:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=ListStoredQueries

Output example :

<?xml version="1.0" encoding="UTF-8"?>
<wfs:DescribeStoredQueriesResponse xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wfs/2.0" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd">
    <StoredQueryDescription id="urn:ogc:def:query:OGC-WFS::GetFeatureById">
        <Title>Get feature by identifier</Title>
        <Abstract>Returns the single feature whose value is equal to the specified value of the ID argument</Abstract>
        <Parameter xmlns:xs="http://www.w3.org/2001/XMLSchema" name="ID" type="xs:string"/>
        <QueryExpressionText xmlns:ms="http://mapserver.gis.umn.edu/mapserver" isPrivate="true" language="urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression" returnFeatureTypes="ms:test_roads"/>
    </StoredQueryDescription>
</wfs:DescribeStoredQueriesResponse>

WFS GetMetadata request.

An operation which returns informal metadata for a particular WFS layer for use if an external formal metadata document is not available.

Required parameters:

project: name of directory where mapfile exists
map: name of mapfile to be used in request
request: name of Maptimus 2 service operation (GetMetadata)
layers: comma-separated list of one or more map layers

URL example:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&request=GetMetadata&layer=test_roads

Output example :

<?xml version="1.0"?>
<gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.isotc211.org/2005/gmd http://www.isotc211.org/2005/gmd/gmd.xsd">
    <gmd:fileIdentifier>
        <gco:CharacterString>test_roads</gco:CharacterString>
    </gmd:fileIdentifier>

...

                </gmd:MD_DigitalTransferOptions>
            </gmd:transferOptions>
        </gmd:MD_Distribution>
    </gmd:distributionInfo>
</gmd:MD_Metadata>