gws.base.ows.server

OWS services.

Base for WMS, WMTS and WFS services.

Configuration

A service (owsService) can be global or project-bound. A global service can be used with any project.

When invoked, the service locates the project (the bound project or projectUid for global services) and collects all suitable layers from the project.

Layers can control their presence in OWS services using withOws and ows configs.

The ows action is required to serve OWS services over http.

XML Namespaces

A WFS service requires each involved layer to have a configured XML namespace (with ows.featureName <ns>:name or ows.xmls <ns>). Additionally, custom namespaces must be configured globally using Application.xml config.

For some layers, we can autogenerate schemas for custom namespaces on the fly from the layer data. To use an autogenerated schema, the schemaLocation attribute for a namespace must be https://<server>/_/owsXml/namespace/<ns>.xsd and the ows action must be enabled globally.

Workflow

  • the ows action receives a request and locates the Service object and the corresponding Project

  • the service initializes the Request (gws.base.ows.server.request.Object)

  • a tree of LayerCaps (gws.base.ows.server.core.LayerCaps) is created (or loaded from the cache)

  • the service filters the caps tree according to the parameters like LAYERS or TYPENAMES and creates a list of suitable leaf layers

  • for image requests, like GetMap, the leaves are rendered, the result is converted to the requested image format and returned

  • for search requests, the service searches the leaves and creates FeatureCollection` objects

  • for search and capabilities requests, a suitable template is located and rendered

Formats

Standard service templates are python templates which use gws.lib.xmlx.tag() to generate nested XML responses.

Standard image formats are image/png and image/jpeg.

Users can configure their own templates and image formats. The “supported formats” lists in OWS capabilities documents are created automatically, based on configured templates and image formats.

References

OGC Standards:

Other implementations:

Source code: gws.base.ows.server

Submodules