:tocdepth: 3 :py:mod:`gws.base.ows.server` ============================= .. py:module:: gws.base.ows.server .. autoapi-nested-parse:: 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 :name`` or ``ows.xmls ``). 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:///_/owsXml/namespace/.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`` (:obj:`gws.base.ows.server.request.Object`) - a tree of ``LayerCaps`` (:obj:`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 :func:`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: - OpenGIS Web Map Service (WMS) Implementation Specification 1.3.0 06-042 https://portal.ogc.org/files/?artifact_id=14416 - Web Map Service 1.1.1 01-068r3 https://portal.ogc.org/files/?artifact_id=1081&format=pdf - OpenGIS Web Map Tile Service Implementation Standard 1.0.0 07-057r7 https://portal.ogc.org/files/?artifact_id=35326 - OpenGIS Web Feature Service 2.0 Interface Standard (also ISO 19142) 2.0 09-025r1 https://portal.ogc.org/files/?artifact_id=39967 - OpenGIS Web Feature Service (WFS) Implementation Specification 1.1.0 04-094 https://portal.ogc.org/files/?artifact_id=8339 - OGC® Web Coverage Service (WCS) Interface Standard – Core, version 2.1 17-089r1 https://portal.opengeospatial.org/files/17-089r1 - OGC Web Service Common Implementation Specification 2.0.0 06-121r9 https://portal.ogc.org/files/?artifact_id=38867 Other implementations: - https://mapserver.org/ogc/wms_server.html - https://docs.geoserver.org/latest/en/user/services/wms/reference.html - https://mapserver.org/ogc/wfs_server.html - https://docs.geoserver.org/latest/en/user/services/wfs/reference.html - https://mapserver.org/ogc/wcs_server.html - https://docs.geoserver.org/latest/en/user/services/wcs/reference.html **Source code:** :source:`gws.base.ows.server` Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 action/index.rst core/index.rst error/index.rst filter/index.rst layer_caps/index.rst request/index.rst service/index.rst templatelib/index.rst Package Contents ---------------- .. py:class:: FeatureCollection(*args, **kwargs) Bases: :py:obj:`gws.Data` Feature Collection. .. py:attribute:: members :type: list[FeatureCollectionMember] .. py:attribute:: numMatched :type: int .. py:attribute:: numReturned :type: int .. py:attribute:: timestamp :type: str .. py:attribute:: values :type: list .. py:class:: FeatureCollectionMember(*args, **kwargs) Bases: :py:obj:`gws.Data` A member of a Feature Collection. .. py:attribute:: feature :type: gws.Feature .. py:attribute:: layer :type: Optional[gws.Layer] .. py:attribute:: layerCaps :type: Optional[LayerCaps] .. py:class:: LayerCaps(*args, **kwargs) Bases: :py:obj:`gws.Data` Layer wrapper object. A `LayerCaps` object wraps a `Layer` object and provides additional data needed to represent a layer in an OWS service. .. py:attribute:: bounds :type: list[gws.Bounds] .. py:attribute:: children :type: list[LayerCaps] .. py:attribute:: featureName :type: str .. py:attribute:: featureNameQ :type: str .. py:attribute:: geometryName :type: str .. py:attribute:: geometryNameQ :type: str .. py:attribute:: hasLegend :type: bool .. py:attribute:: isGroup :type: bool .. py:attribute:: isSearchable :type: bool .. py:attribute:: layer :type: gws.Layer .. py:attribute:: layerName :type: str .. py:attribute:: layerNameQ :type: str .. py:attribute:: leaves :type: list[LayerCaps] .. py:attribute:: maxScale :type: int .. py:attribute:: minScale :type: int .. py:attribute:: model :type: Optional[gws.Model] .. py:attribute:: title :type: str .. py:attribute:: xmlNamespace :type: Optional[gws.XmlNamespace] .. py:class:: TemplateArgs(*args, **kwargs) Bases: :py:obj:`gws.TemplateArgs` Arguments for service templates. .. py:attribute:: featureCollection :type: gws.base.ows.server.core.FeatureCollection .. py:attribute:: gmlVersion :type: int .. py:attribute:: intVersion :type: int .. py:attribute:: layerCapsList :type: list[gws.base.ows.server.core.LayerCaps] .. py:attribute:: service :type: gws.OwsService .. py:attribute:: serviceUrl :type: str .. py:attribute:: sr :type: Object .. py:attribute:: tileMatrixSets :type: list[gws.TileMatrixSet] .. py:attribute:: url_for :type: Callable .. py:attribute:: version :type: str