Introduction
In this exercise you will learn how to set up the software MapServer as a Web Feature Service using the Open Geospatial Consortium's OWS standards, from data stored in a PostGIS database. In earlier exercises you used MapServer to create a WMS Server. We will apply the same software now for the development of a Web Feature Server (WFS). You wil learn how to set up the software as a Web Feature Service using the Open Geospatial Consortium's OWS standards.
NOTE that this is meant as a follow-up to the exercise Creating an OGC Web Map Service Using MapServer and PostGIS. The description is written supposing you have succesfully finished that earlier exercise...!
A Web Feature Service publishes feature-level geospatial data on the web. Instead of returning an image, as a WMS does, the WFS delivers the actual data: fine-grained information about specific geospatial features of the underlying data at both the geometry and the attribute levels.
In a similar fashion as WMS, WFS allows a client to receive and update geospatial data from multiple Web Feature Services. Also, a WFS can serve as the data source for a WMS. As with other OGC specifications the WFS interface uses XML over HTTP as its delivery mechanism. In most case the output is Geography Markup Language
(GML) which is an XML language also standardised by the OGC. But many WFS servers can also deliver other vector formats, such as KML, GeoJSON, geoPackage, or even shapefiles. As with all OGC standards, the client software can find out about these formats by executing a GetCapabilities
request first...
Note that due to the Mapserver software architecture, it can not offer WFS-T(ransactional) services: You can only load data from the WFS, not use the WFS to insert, update or delete data from the datastore. Other WFS software is available that does support the WFS-T standards (e.g. OSGeo's GeoServer software).