Template:OGC WFS
From MapbenderWiki
Lesen Sie hier die deutsche Version
Contents |
Description
The OGC (Open Geospatial Consortium) has created the Web Feature Service (WFS) specification. Find the details of the specification in the OGC Specifications section. The WFS document defines several request types:
- getCapabilities
- describeFeatureType
- getFeature
These requests return full features (geometries with attributes) from the server. This is the extended version of the OGC WMS getFeatureInfo request which only returns the information about the feature but not the geometry itself. WFS clients help to access OGC WFS services by providing user interfaces to create queries and selections, activating layers (FeatureTypes), etc.
Mapbender WFS Client Capabilities
Mapbender extends this functionality with WMS client functionality, creating, editing and deleting features, user administration and access control. Test the search and highlight functionaltiy in the Web Feature Service Demo and use the Digitizing interface with a transactional WFS to create, edit and maintain features (geometries) simply by using a web browser.
Read more about WFS Configuration.
Technical description
getCapabilities
The getCapabilities call returns an OGC WFS Capabilities Document (XML) which contains all information that an OGC WFS Client needs to request the server for features.
describeFeatureType
This request returns all metainformation about one feature of the WFS. This metainformation is necessary to be able to query for the values of an object and to be able to edit and store features.
http://my_wfs_server&VERSION=1.1.1&REQUEST=GetCapabilities&SERVICE=WFS
The returned XML document contains the description of the feature (geo object)
(the format of the XML has been modified for HTML presentation)
<xs:schema targetNamespace="http://www.openplans.org/topp" elementFormDefault="qualified"
attributeFormDefault="unqualified" version="1.0">
<xs:import namespace="http://www.opengis.net/gml"
schemaLocation="http://wms1.ccgis.de:80/geoserver/data/capabilities/gml/2.1.2/feature.xsd"/>
<xs:complexType name="mapbender_user_Type">
<xs:complexContent>
<xs:extension base="~gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="gid" minOccurs="0" nillable="true" type="xs:int"/>
<xs:element name="firstname" minOccurs="0" nillable="true" type="xs:string"/>
<xs:element name="lastname" minOccurs="0" nillable="true" type="xs:string"/>
<xs:element name="usertype" minOccurs="0" nillable="true" type="xs:int"/>
<xs:element name="orga" minOccurs="0" nillable="true" type="xs:string"/>
<xs:element name="url" minOccurs="0" nillable="true" type="xs:string"/>
<xs:element name="town" minOccurs="0" nillable="true" type="xs:string"/>
<xs:element name="email" minOccurs="0" nillable="true" type="xs:string"/>
<xs:element name="fullname" minOccurs="0" nillable="true" type="xs:string"/>
<xs:element name="urlmap" minOccurs="0" nillable="true" type="xs:string"/>
<xs:element name="the_geom" minOccurs="0" nillable="true" type="~gml:PointPropertyType"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="mapbender_user" type="topp:mapbender_user_Type" substitutionGroup="gml:_Feature"/>
</xs:schema>
GetFeature
The GetFeature request can query for single objects or a selection depending on the filter encoding which is added to the request. The OGC WFS ~getFeature request returns a GML (Example) document.
The parameter requesting the id of the postal code area is added as a WFS FILTER to the getFeature request as http GET parameter.
==== http://wms1.ccgis.de/cgi-bin/mapserv425?map=/data/umn/germany_demo/germany_demo_wfs.map& ==== SERVICE=WFS& REQUEST=~GetFeature& VERSION=1.0.0& TYPENAME=Postleitzahlbereiche& FILTER=
(the following parameters have to be URL-encoded when transmitted with GET)
<Filter>
<~PropertyIsLike wildCard="%" singleChar="?" escape="ESC">
<~PropertyName>
item_plz
</~PropertyName>
<Literal>
53111
</Literal>
</~PropertyIsLike>
</Filter>
The returned GML document contains the corresponding post code polygon including alphanumeric attributes.
(the format of the GML has been modified for HTML presentation)
<?xml version='1.0' encoding="ISO-8859-1" ?>
<wfs:~FeatureCollection
xmlns="!http://www.ttt.org/myns"
xmlns:myns="!http://www.ttt.org/myns"
xmlns:wfs="!http://www.opengis.net/wfs"
xmlns:gml="!http://www.opengis.net/gml"
xmlns:ogc="!http://www.opengis.net/ogc"
xmlns:xsi="!http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="!http://www.opengis.net/wfs ../wfs/1.0.0/WFS-basic.xsd
!http://www.ttt.org/myns
!http://wms1.ccgis.de/cgi-bin/mapserv?
map=/data/umn/germany_demo/germany_demo_wfs.map&
SERVICE=WFS&
VERSION=1.0.0&
REQUEST=~DescribeFeatureType
TYPENAME=Postleitzahlbereiche">
<gml:boundedBy>
<gml:Box srsName="epsg:31467">
<gml:coordinates>
-1.000000,-1.000000 -1.000000,-1.000000
</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<Postleitzahlbereiche>
<gml:boundedBy>
<gml:Box srsName="epsg:31467">
<gml:coordinates>
7.089682,50.732651 7.113803,50.749050
</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:polygonProperty>
<gml:Polygon srsName="epsg:31467">
<gml:outerBoundaryIs>
<gml:~LinearRing>
<gml:coordinates>
3365496.566430,5624978.448441
3365521.124423,5625013.908323
3365565.223312,5625084.526916
3365629.214635,5625160.583843
3365723.363724,5625232.038551
3365777.825572,5625277.769189
3365867.287406,5625324.293319
3366081.776121,5625376.954252
3366242.558916,5625409.342895
3366447.711508,5625422.348649
3366677.856852,5625435.565091
3366826.787403,5624801.669664
3366855.035066,5624566.573031
3366925.451142,5624182.224968
3366715.750264,5624144.261254
3366650.863977,5624128.508596
3366600.955317,5624112.804621
3366531.383108,5624081.886701
3366506.401347,5624071.486493
3366442.053224,5624025.159618
3366392.576627,5623979.714963
3366347.846258,5623958.781918
3366303.629382,5623898.347600
3366254.562142,5623822.330657
3366204.783816,5623801.958859
3366170.529172,5623746.359034
3366096.979434,5623625.121634
3365763.215463,5623795.455427
3365500.779929,5623942.335246
3365218.803228,5624068.496482
3365237.785434,5624138.909926
3365251.877503,5624209.028949
3365265.770476,5624284.252033
3365279.898174,5624354.790930
3365313.834894,5624430.338190
3365342.788540,5624515.791264
3365381.492255,5624611.601424
3365424.880011,5624732.334672
3365458.518013,5624832.944095
3365502.496403,5624908.664231
3365531.735324,5624963.958282
3365496.566430,5624978.448441
</gml:coordinates>
</gml:~LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</gml:polygonProperty>
<gid>3695</gid>
<oid>15223704</oid>
<plz99>53111</plz99>
<item_plz>53111</item_plz>
<buffer_>500</buffer_>
</Postleitzahlbereiche>
</gml:featureMember>
</wfs:~FeatureCollection>
How to make use of the WFS?
The OGC WFS is commonly mistaken for a simple spatial data download server. Beside other things this is one of the potential uses but far from the only one. In most cases the exchange format of a WFS server is GML. This GML can be searched for, it can be edited and written back:
- Search for features geographically
- Search for geographic features with specified alphanumerical attributes
- Perform operations on geographic feature
- Permanent storage of geographic features
