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

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@3696
Revision 3696, 4.1 KB checked in by spascoe, 12 years ago (diff)

Implementation of GetFeatureInfo?. Not tested yet but the interface
described in wms_iface.py should remain constant.

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    @ivar queryable
38    @type queryable: Boolean
39
40    """
41    def __init__(self, CRSs=[], styles=[''], dimensions={}, attribution=None, authorityURLs=[],
42                 dataURLs=[], featureListURLs=[],
43                 minScaleDenominator=None, maxScaleDenominator=None,
44                 queryable=False, **kw):
45        super(WmsDatasetSummary, self).__init__(**kw)
46
47        self.CRSs = CRSs
48        self.styles = styles
49        self.dimensions = dimensions
50        self.attribution = attribution
51        self.authorityURLs = authorityURLs
52        self.dataURLs = dataURLs
53        self.featureListURLs = featureListURLs
54        self.minScaleDenominator = minScaleDenominator
55        self.maxScaleDenominator = maxScaleDenominator
56        self.queryable = queryable
57
58class Style(object):
59    """
60    @ivar name
61    @type name: str
62    @ivar title
63    @type title: str
64    @ivar abstract
65    @type abstract: None or str
66    @ivar legendURLs
67    @type legendURLS: iterable of LegendURL objests
68    @ivar styleSheetURL
69    @type styleSheetURL: None or FormattedURL object
70    @ivar styleURL
71    @type styleURL: None or FormattedURL object
72
73    """
74    def __init__(self, name, title, abstract=None, legendURLs=[], styleSheetURL=None,
75                 styleURL=None):
76        self.name = name
77        self.title = title
78        self.abstract = abstract
79        self.legendURLs = legendURLs
80        self.styleSheetURL = styleSheetURL
81        self.styleURL = styleURL
82
83class FormattedURL(object):
84    """
85    @ivar format
86    @type format: str
87    @ivar onlineResource
88    @type onlineResource: OnlineResource object
89
90    """
91    def __init__(self, format, onlineResource):
92        self.format = format
93        self.onlineResource = onlineResource
94
95class LegendURL(FormattedURL):
96    """
97    @ivar width
98    @type width: None or int
99    @ivar height:
100    @type height: None or int
101
102    """
103    def __init__(self, width, height, **kw):
104        super(LegendURL, self).__init__(**kw)
105       
106        self.width = width
107        self.height = height
108
109class Dimension(Domain):
110    """
111    Use Domain attributes where possible.
112   
113    @ivar multipleValues
114    @type multipleValues: boolean (default False)
115    @ivar nearestValue
116    @type nearestValue: boolean (default False)
117    @ivar current
118    @type current: boolean (default False)
119    @ivar unitSymbol: Unit symbol could probably be taken from the Domain
120        structure but it isn't clear where (the meaning or dataType
121        attributes?).
122    @type unitSymbol: str
123
124    """
125    def __init__(self, multipleValues=False, nearestValue=False,
126                 current=False, unitSymbol=None, **kw):
127        super(Dimension, self).__init__(**kw)
128       
129        self.multipleValues = multipleValues
130        self.nearestValue = nearestValue
131        self.current = current
132        self.unitSymbol = unitSymbol
133
134#
135#!TODO: Other objects referenced by WmsDatasetSummary
136#
Note: See TracBrowser for help on using the repository browser.