Home | Docs | Issue Tracker | FAQ | Download | |
WFS is an Open Geospatial Consortium (OGC) specification. For more information about the format itself, see: http://www.opengeospatial.org/standards/wfs
WFS allows a client to retrieve geospatial data encoded in Geography Markup Language (GML) from multiple Web Feature Services. GML is built on the standard web language XML.
WFS differs from the popular Web Map Service (WMS) specification in that WFS returns a subset of the data in valid GML format, not just a graphic image of data.
Requesting the capabilities using the GetCapabilities request to a WFS server returns an XML document showing what layers and projections are available, etc. Example of a WFS GetCapabilities URL:
Example of the Resulting XML from GetCapabilties:
...
<FeatureTypeList>
<Operations>
<Query/>
</Operations>
<FeatureType>
<Name>continents</Name>
<Title>World continents</Title>
<SRS>EPSG:4326</SRS>
<LatLongBoundingBox minx="-180" miny="-90" maxx="180" maxy="83.6274"/>
</FeatureType>
<FeatureType>
<Name>cities</Name>
<Title>World cities</Title>
<SRS>EPSG:4326</SRS>
<LatLongBoundingBox minx="-178.167" miny="-54.8" maxx="179.383" maxy="78.9333"/>
</FeatureType>
</FeatureTypeList>
...
Example of a WFS Request Directly Through the Browser:
The following URL requests the GML for the layer continents. (see the GetCapabilities above for the possible layers available on this test server) . The URL is all one line, broken up here for readability (click here for a working link).
http://demo.mapserver.org/cgi-bin/wfs?
SERVICE=WFS&
VERSION=1.0.0&
REQUEST=getfeature&
TYPENAME=continents&
MAXFEATURES=100
LAYER
NAME "continents"
TYPE POLYGON
STATUS ON
CONNECTION "http://demo.mapserver.org/cgi-bin/wfs?"
CONNECTIONTYPE WFS
METADATA
"wfs_typename" "continents"
"wfs_version" "1.0.0"
"wfs_connectiontimeout" "60"
"wfs_maxfeatures" "10"
END
PROJECTION
"init=epsg:4326"
END
CLASS
NAME "Continents"
STYLE
COLOR 255 128 128
OUTLINECOLOR 96 96 96
END
END
END # Layer