Geo::OGC::Service::WFS - Perl extension for geospatial web feature services


The process_request method of this module is called by the Geo::OGC::Service framework.


This module aims to provide the operations defined by the Open Geospatial Consortium's Web Feature Service standard. These are (in the version 2.0 of the standard)

 GetCapabilities (discovery operation) (*)
 DescribeFeatureType (discovery operation) (*)
 GetPropertyValue (query operation)
 GetFeature (query operation) (*)
 GetFeatureWithLock (query & locking operation)
 LockFeature (locking operation)
 Transaction (transaction operation) (*)
 CreateStoredQuery (stored query operation)
 DropStoredQuery (stored query operation)
 ListStoredQueries (stored query operation)
 DescribeStoredQueries (stored query operation)

(*) are at least somehow implemented.

This module is a plugin for the Geo::OGC::Service framework.


None by default.



The entry method into this service. Fails unless the request is well known.


Service the GetCapabilities request. The configuration JSON is used to control the contents of the reply. The config contains root keys, which are either simple or complex. The simple root keys are

 Key                 Default             Comment
 ---                 -------             -------
 version             2.0.0
 Title               WFS Server
 resource                                required
 AcceptVersions      2.0.0,1.1.0,1.0.0
 Transaction                             optional

FeatureTypeList is a root key, which is a list of FeatureType hashes. A FeatureType defines one layer (key Layer exists) or a group of layers (key Layer does not exist). The key DataSource is required - it is a GDAL data source string. Currently only PostGIS layers are supported.

If Layer is specified, then also keys Name, Title, Abstract, and DefaultSRS are required, and LowerCorner is optional.

For PostGIS groups the default is open. The names of the layers are constructed from a prefix, which is a required key, name of the table or view, and the name of the geometry column, e.g., prefix.table.geom. The listed layers can be restricted with keys TABLE_TYPE, TABLE_PREFIX, deny, and allow. TABLE_TYPE, deny, and allow are, if exist, hashes. The keys of the first are table types as DBI reports them, and the keys of the deny and allow are layer names (the prefix can be left out). TABLE_PREFIX is a string that sets a requirement for the table/view names for to be listed.


Service the DescribeFeatureType request.


Not yet implemented.


Service the GetFeature request. The response is generated with the GML driver of GDAL using options TARGET_NAMESPACE, PREFIX, and FORMAT. They are from the root of the configuration (TARGET_NAMESPACE from FeatureType falling back to root) falling back to default ones "", "wfs", and "GML3.2". The content type of the reponse is from configuration (root key 'Content-Type') falling back to default "text/xml".

The "gml:id" attribute of the features is GDAL generated or from a field defined by the key "gml:id" in the configuration (in the hash with layer name falling back to FeatureType).


Not yet implemented.


Not yet implemented.


Service the Transaction request. Transaction support is only implemented for PostgreSQL data sources. "Replace" operations are not yet supported.


Not yet implemented.


Not yet implemented.


Not yet implemented.


Not yet implemented.


Discuss this module on the Geo-perl email list.

For the WFS standard see



Ari Jolma, <ari.jolma at>


Copyright (C) 2015- by Ari Jolma

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.22.0 or, at your option, any later version of Perl 5 you may have available.