Creating an OGC Web Feature Service
Using MapServer and PostGIS

Creating a WFS Server

The MapServer software can be configured to offer the OGC standardised service interfaces for a Web Feature Service (WFS). Note that this will only work properly for LAYERs that meet the following conditions:

  • The data source is of a vector type (points, lines, polygons from e.g. shapefiles or PostGIS); LAYER TYPE therefore is one of: POINT, LINE, or POLYGON;
  • LAYER NAME must be set; Layer names must start with a letter (not a number) and must not have spaces in them;
  • In the layer definition, the statement DUMP TRUE is included;
  • The wfs_onlineresource metadata is set in the WEB objects METADATA and specifies the URL that should be used to access your server.

Listing 1 below is an example of a bare minimum WFS Map File with just one layer.

Create a file in the root of your Thailand site with the name configWFS.map and copy the contents of Listing 1 into it. Do not forget to exchange the [NETPATH] parameters with its proper value, as you should have learned in the earlier WMS exercise...