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
owsaction receives a request and locates the Service object and the corresponding Projectthe 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
LAYERSorTYPENAMESand creates a list of suitable leaf layersfor image requests, like
GetMap, the leaves are rendered, the result is converted to the requested image format and returnedfor search requests, the service searches the leaves and creates
FeatureCollection`objectsfor 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:
- OpenGIS Web Map Service (WMS) Implementation Specification 1.3.0 06-042
- Web Map Service 1.1.1 01-068r3
- OpenGIS Web Map Tile Service Implementation Standard 1.0.0 07-057r7
- OpenGIS Web Feature Service 2.0 Interface Standard (also ISO 19142) 2.0 09-025r1
- OpenGIS Web Feature Service (WFS) Implementation Specification 1.1.0 04-094
- OGC® Web Coverage Service (WCS) Interface Standard – Core, version 2.1 17-089r1
- OGC Web Service Common Implementation Specification 2.0.0 06-121r9
Other implementations:
Source code: gws.base.ows.server
Submodules¶
Package Contents¶
- class gws.base.ows.server.FeatureCollection(*args, **kwargs)¶
Bases:
gws.DataFeature Collection.
- members: list[FeatureCollectionMember]¶
- numMatched: int¶
- numReturned: int¶
- timestamp: str¶
- values: list¶
- class gws.base.ows.server.FeatureCollectionMember(*args, **kwargs)¶
Bases:
gws.DataA member of a Feature Collection.
- feature: gws.Feature¶
- class gws.base.ows.server.LayerCaps(*args, **kwargs)¶
Bases:
gws.DataLayer wrapper object.
A
LayerCapsobject wraps aLayerobject and provides additional data needed to represent a layer in an OWS service.- bounds: list[gws.Bounds]¶
- featureName: str¶
- featureNameQ: str¶
- geometryName: str¶
- geometryNameQ: str¶
- hasLegend: bool¶
- isGroup: bool¶
- isSearchable: bool¶
- layerName: str¶
- layerNameQ: str¶
- maxScale: int¶
- minScale: int¶
- title: str¶
- xmlNamespace: gws.XmlNamespace | None¶
- class gws.base.ows.server.MetadataCollection(*args, **kwargs)¶
Bases:
gws.DataMetadata Collection.
- members: list[gws.Metadata]¶
- nextRecord: int¶
- numMatched: int¶
- numReturned: int¶
- timestamp: str¶
- class gws.base.ows.server.TemplateArgs(*args, **kwargs)¶
Bases:
gws.TemplateArgsArguments for service templates.
- featureCollection: gws.base.ows.server.core.FeatureCollection¶
- gmlVersion: int¶
- intVersion: int¶
- layerCapsList: list[gws.base.ows.server.core.LayerCaps]¶
- metadataCollection: gws.base.ows.server.core.MetadataCollection¶
- operation: gws.OwsOperation¶
- project: gws.Project¶
- service: gws.OwsService¶
- serviceUrl: str¶
- tileMatrixSets: list[gws.TileMatrixSet]¶
- url_for: Callable¶
- version: str¶