source: TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/model/wms.py @ 3553

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/model/wms.py@3553
Revision 3553, 4.0 KB checked in by spascoe, 12 years ago (diff)

Moved all the model classes into their own sub-module.

Line 
1# Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council).
2# This software may be distributed under the terms of the
3# Q Public License, version 1.0 or later.
4# http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt
5"""
6Extends ows_common classes where necessary for implementing WMS 1.3.0
7
8@author: Stephen Pascoe
9"""
10
11from ows_common.model.contents import DatasetSummary
12from ows_common.model.domain import Domain
13
14class WmsDatasetSummary(DatasetSummary):
15    """
16    We don't know how WMS will map Layer attributes onto an extension of DatasetSummary
17    so a pragmatic approach is taken here.
18   
19    @ivar CRSs
20    @type CRSs: iterable of str
21    @ivar styles: Style descriptors, default ['']
22    @type styles: iterable of Style objects
23    @ivar dimensions
24    @type dimensions: dictionary mapping dimension names to Dimension objects
25    @ivar attribution
26    @type attribution: None or Attribution object
27    @ivar authorityURLs
28    @type authorityURLs: iterable of AuthorityUrl objects
29    @ivar dataURLs
30    @type dataURLs: iterable of DataUrl objects
31    @ivar featureListURLs
32    @type featureListURLS: iterable of FeatureListURL objects
33    @ivar minScaleDenominator
34    @type minScaleDenominator: None or double
35    @ivar maxScaleDenominator
36    @type maxScaleDenominator: None or double
37
38    """
39    def __init__(self, CRSs=[], styles=[''], dimensions={}, attribution=None, authorityURLs=[],
40                 dataURLs=[], featureListURLs=[],
41                 minScaleDenominator=None, maxScaleDenominator=None, **kw):
42        super(WmsDatasetSummary, self).__init__(**kw)
43
44        self.CRSs = CRSs
45        self.styles = styles
46        self.dimensions = dimensions
47        self.attribution = attribution
48        self.authorityURLs = authorityURLs
49        self.dataURLs = dataURLs
50        self.featureListURLs = featureListURLs
51        self.minScaleDenominator = minScaleDenominator
52        self.maxScaleDenominator = maxScaleDenominator
53
54
55class Style(object):
56    """
57    @ivar name
58    @type name: str
59    @ivar title
60    @type title: str
61    @ivar abstract
62    @type abstract: None or str
63    @ivar legendURLs
64    @type legendURLS: iterable of LegendURL objests
65    @ivar styleSheetURL
66    @type styleSheetURL: None or FormattedURL object
67    @ivar styleURL
68    @type styleURL: None or FormattedURL object
69
70    """
71    def __init__(self, name, title, abstract=None, legendURLs=[], styleSheetURL=None,
72                 styleURL=None):
73        self.name = name
74        self.title = title
75        self.abstract = abstract
76        self.legendURLs = legendURLs
77        self.styleSheetURL = styleSheetURL
78        self.styleURL = styleURL
79
80class FormattedURL(object):
81    """
82    @ivar format
83    @type format: str
84    @ivar onlineResource
85    @type onlineResource: OnlineResource object
86
87    """
88    def __init__(self, format, onlineResource):
89        self.format = format
90        self.onlineResource = onlineResource
91
92class LegendURL(FormattedURL):
93    """
94    @ivar width
95    @type width: None or int
96    @ivar height:
97    @type height: None or int
98
99    """
100    def __init__(self, width, height, **kw):
101        super(LegendURL, self).__init__(**kw)
102       
103        self.width = width
104        self.height = height
105
106class Dimension(Domain):
107    """
108    Use Domain attributes where possible.
109   
110    @ivar multipleValues
111    @type multipleValues: boolean (default False)
112    @ivar nearestValue
113    @type nearestValue: boolean (default False)
114    @ivar current
115    @type current: boolean (default False)
116    @ivar unitSymbol: Unit symbol could probably be taken from the Domain
117        structure but it isn't clear where (the meaning or dataType
118        attributes?).
119    @type unitSymbol: str
120
121    """
122    def __init__(self, multipleValues=False, nearestValue=False,
123                 current=False, unitSymbol=None, **kw):
124        super(Dimension, self).__init__(**kw)
125       
126        self.multipleValues = multipleValues
127        self.nearestValue = nearestValue
128        self.current = current
129        self.unitSymbol = unitSymbol
130
131#
132#!TODO: Other objects referenced by WmsDatasetSummary
133#
Note: See TracBrowser for help on using the repository browser.