Coverage for gws-app/gws/base/ows/server/__init__.py: 0%
3 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-17 01:37 +0200
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-17 01:37 +0200
1"""OWS services.
3Base for ``WMS``, ``WMTS`` and ``WFS`` services.
5Configuration
6-------------
8A service (``owsService``) can be global or project-bound. A global service can be used with any project.
10When invoked, the service locates the project (the bound project or ``projectUid`` for global services)
11and collects all suitable layers from the project.
13Layers can control their presence in OWS services using ``withOws`` and ``ows`` configs.
15The ``ows`` action is required to serve OWS services over http.
17XML Namespaces
18--------------
20A ``WFS`` service requires each involved layer to have a configured XML namespace (with ``ows.featureName <ns>:name`` or ``ows.xmls <ns>``).
21Additionally, custom namespaces must be configured globally using ``Application.xml`` config.
23For some layers, we can autogenerate schemas for custom namespaces on the fly from the layer data.
24To use an autogenerated schema, the ``schemaLocation`` attribute for a namespace must be ``https://<server>/_/owsXml/namespace/<ns>.xsd``
25and the ``ows`` action must be enabled globally.
27Workflow
28--------
30- the ``ows`` action receives a request and locates the Service object and the corresponding Project
31- the service initializes the ``Request`` (:obj:`gws.base.ows.server.request.Object`)
32- a tree of ``LayerCaps`` (:obj:`gws.base.ows.server.core.LayerCaps`) is created (or loaded from the cache)
33- the service filters the caps tree according to the parameters like ``LAYERS`` or ``TYPENAMES`` and creates a list of suitable leaf layers
34- for image requests, like ``GetMap``, the leaves are rendered, the result is converted to the requested image format and returned
35- for search requests, the service searches the leaves and creates `FeatureCollection`` objects
36- for search and capabilities requests, a suitable template is located and rendered
39Formats
40-------
42Standard service templates are python templates which use :func:`gws.lib.xmlx.tag` to generate nested XML responses.
44Standard image formats are ``image/png`` and ``image/jpeg``.
46Users can configure their own templates and image formats. The "supported formats" lists in OWS capabilities documents
47are created automatically, based on configured templates and image formats.
50References
51----------
53OGC Standards:
55- OpenGIS Web Map Service (WMS) Implementation Specification 1.3.0 06-042
56 https://portal.ogc.org/files/?artifact_id=14416
58- Web Map Service 1.1.1 01-068r3
59 https://portal.ogc.org/files/?artifact_id=1081&format=pdf
61- OpenGIS Web Map Tile Service Implementation Standard 1.0.0 07-057r7
62 https://portal.ogc.org/files/?artifact_id=35326
64- OpenGIS Web Feature Service 2.0 Interface Standard (also ISO 19142) 2.0 09-025r1
65 https://portal.ogc.org/files/?artifact_id=39967
67- OpenGIS Web Feature Service (WFS) Implementation Specification 1.1.0 04-094
68 https://portal.ogc.org/files/?artifact_id=8339
70- OGC® Web Coverage Service (WCS) Interface Standard – Core, version 2.1 17-089r1
71 https://portal.opengeospatial.org/files/17-089r1
73- OGC Web Service Common Implementation Specification 2.0.0 06-121r9
74 https://portal.ogc.org/files/?artifact_id=38867
76Other implementations:
78- https://mapserver.org/ogc/wms_server.html
79- https://docs.geoserver.org/latest/en/user/services/wms/reference.html
80- https://mapserver.org/ogc/wfs_server.html
81- https://docs.geoserver.org/latest/en/user/services/wfs/reference.html
82- https://mapserver.org/ogc/wcs_server.html
83- https://docs.geoserver.org/latest/en/user/services/wcs/reference.html
84"""
86from .core import (
87 LayerCaps,
88 FeatureCollection,
89 FeatureCollectionMember,
90)
91from . import service, layer_caps, request, error
92from .request import TemplateArgs