source: cows/trunk/cows/service/wxs_iface.py @ 4912

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/trunk/cows/service/wxs_iface.py@5399
Revision 4912, 2.3 KB checked in by spascoe, 13 years ago (diff)

Added LICENSE file and a short banner at the top of each python file.
Use add_license.py to add a license to new files.

NOTE: also contains a couple of files missed at last commit.

Line 
1# BSD Licence
2# Copyright (c) 2009, Science & Technology Facilities Council (STFC)
3# All rights reserved.
4#
5# See the LICENSE file in the source distribution of this software for
6# the full license text.
7
8"""
9The classes in this module define the base interface between the OWS Pylons
10server and components that provide Web X Server layers.  The
11intention is that a WXS can be created for a given datatype and
12rendering engine by creating classes that implement these base interfaces
13and implement service specific interfaces as defined in:
14wms_iface.py
15wfs_iface.py
16wcs_iface.py
17etc.
18
19-- there is no need to mess around with Pylons controllers or the
20cows metadata model.
21
22The main entry point for the OWS Pylons server is the ILayerMapper
23interface.  This provides a mechanism for serving multiple WxS
24endpoints through a single server.  Keywords deduced from the pylons
25routes mapper are passed to the ILayerMapper instance to return a
26dictionary of ILayer instances.  These are the layers available to the
27WxS on this route.
28
29It is expected that implementing classes will inherit from these
30interface classes, using them as abstract base classes.  However, in
31the future zope.Interface might be used to associate interfaces with
32implementations.
33
34
35"""
36
37class ILayerMapper(object):
38    """
39    Maps keyword arguments to a collection of layers.
40
41    ILayerMapper supports the retrieval of sets of layers according to arbitary
42    keyword/value pairs.
43
44    """
45    def map(self, **kwargs):
46        """
47        Given arbitary keywords/value pairs list the names of
48        all layers available.
49
50        @return: A mapping of layer names to ILayer implementations.
51        @raise ValueError: If no layers are available for these keywords.
52
53        """
54        raise NotImplementedError
55
56class ILayer(object):
57    """
58    An base interface representing a WxS contents "layer" (e.g. coverage, layer, feature).
59
60    @ivar title: The layer title.  As seen in the Capabilities document.
61    @ivar abstract:  Abstract as seen in the Capabilities document.
62
63    """
64    title = abstract = NotImplemented
65    featureInfoFormats = NotImplemented
66
67    def getBBox(self, crs):
68        """
69        @return: the bounding box (llx, lly, urx, ury) of the data in the given
70            coordinate reference system.
71
72        """
73        raise NotImplementedError
74
Note: See TracBrowser for help on using the repository browser.