OGC Web Feature Service

http://opengeospatial.org/standards/wfs

Publish geospatial vector data from data stored on server to the client.

Mandatory parameters for the data request:

  • TYPENAME - list of feature types

Optional parameters:

  • BBOX
  • FILTER
  • FEATUREID
  • PROPERTYNAME

WFS Server should be able to handle 3 types of requests:

  • GetCapabilities - retrieves server metadata (encoded as XML document)
  • GetFeature - retrieves vector data
  • DescribeFeatureType - retrieves schema of the database
  • LockFeature - for editing
  • GetFeatureWithLock - get fetaure and lock it

Testing OGC WFS directly

Since we deployed our service as WFS too, we should be able to download Roads data as GML. The GetCapabilities request should look like:

http://147.32.26.113:91/cgi-bin/qgis_mapserv.fcgi?
map=NAME/project.qgs&         <-- NOTE: this is not part of the WFS standard
service=WFS&
version=1.0.0&
request=GetCapabilities

Concrete example in our case:

Now we can download layer Primary_road as GML file:

Adding WFS layer to QGIS

Note

It’s worth to start a new empty QGIS project for this step to avoid confusion by all the layers you may have in the layer switcher.

  1. Add new WFS server (Layer ‣ Add WFS Layer ‣ New server)

  2. Select required layer

    ../_images/18_wfs.png

    Fig. 77 Select e.g. Primary_road layer (or more, if you want)

  3. As result - you have new layer from the WFS server in your map

    ../_images/19_wfs.png
  4. If enabled, QGIS is even able to update the data and send them back to the server (using WFS-T standard)