Coverage for gws-app/gws/plugin/ows_client/__init__.py: 100%

0 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-10-05 13:35 +0200

1"""Clients for remote OGC web services. 

2 

3This plugin lets GBD WebSuite use external WMS, WMTS and WFS services as 

4data sources for layers, search and models. The protocol-independent parts 

5(the base provider, request helpers, capabilities parsing utilities, the 

6generic finder and model) live in ``gws.base.ows.client``; the subpackages 

7here implement the protocols on top of them. 

8 

9Subpackages: 

10 

11- ``wms``: WMS client. Provides the ``wms`` tree layer, the ``wmsflat`` image 

12 layer, a GetFeatureInfo finder and a model. 

13- ``wmts``: WMTS client. Provides the ``wmts`` tile layer. 

14- ``wfs``: WFS client. Provides the ``wfs`` tree layer, the ``wfsflat`` vector 

15 layer, a GetFeature finder and a model. 

16 

17Each subpackage has a ``provider`` module with the service provider object. 

18The provider downloads and parses the capabilities document and performs the 

19actual requests (GetMap, GetTile, GetFeatureInfo, GetFeature). Layers, finders 

20and models refer to a provider through their ``provider`` configuration; a 

21provider created from the same configuration is shared between objects. 

22 

23Tree layers (``wms``, ``wfs``) create a group with a child layer for each 

24source layer of the service. The children are flat layers (``wmsflat``, 

25``wfsflat``) that reuse the provider of the group. 

26 

27Example:: 

28 

29 map.layers+ { 

30 title "Base map" 

31 type "wmts" 

32 provider.url "https://example.com/wmts/1.0.0/WMTSCapabilities.xml" 

33 sourceLayers.names ["base_map"] 

34 } 

35 

36 map.layers+ { 

37 title "Districts" 

38 type "wmsflat" 

39 provider.url "https://example.com/wms" 

40 sourceLayers.names ["districts"] 

41 } 

42 

43 map.layers+ { 

44 title "Districts (vector)" 

45 type "wfsflat" 

46 provider.url "https://example.com/wfs" 

47 sourceLayers.names ["ns:districts"] 

48 } 

49"""