source: mauRepo/MolesManager/trunk/src/ea_model/iso_19123_2005_coverages/coverages/coverage_core/cv_continuouscoverage.py @ 8091

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19123_2005_coverages/coverages/coverage_core/cv_continuouscoverage.py@8091
Revision 8091, 5.0 KB checked in by mnagni, 8 years ago (diff)

The migration process now includes
1) deployment_data files
2) XML document hash
3) full Dojo support


Line 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21from ea_model.iso_19123_2005_coverages.coverages.coverage_core.cv_coverage import  CV_Coverage
22from ascore.utils import has_value
23
24'''
25Created on 16-Feb-2012 16:18:09
26
27@author: mnagni
28'''
29
30class CV_ContinuousCoverage(CV_Coverage):
31    '''
32        Represents a data entity defined in a UML diagram and supposed to
33        be persisted in a relational database.
34 
35        This class has been genererated automatically using the Apache Velocity project.
36    '''
37    '''
38        Please note that any access to the inner attributes should be done using
39        the given get/set methods and NOT accessing them directly.
40    '''
41    def __init__(self):
42        self._cv_coverage = CV_Coverage()       
43
44        self.domainExtent = []
45        self.interpolationType = None
46        self._CRS_sc_singlecrs = None
47        self._CRS_sc_compoundcrs = None
48        self.domainElement = []
49        self.commonPointRule = None
50        self.rangeType = None
51        self._element_cv_valuehexagon = []
52        self._element_cv_gridvaluecell = []
53        self._element_cv_valuecurve = []
54        self._element_cv_valuetriangle = []
55        self._element_cv_thiessenvaluepolygon = []
56        self.rangeElement = []
57        self.interpolationParametersType = None
58        super(CV_ContinuousCoverage, self).__init__()
59
60    @property
61    def domainExtent(self):     
62        return self._cv_coverage.domainExtent
63
64    @domainExtent.setter
65    def domainExtent(self, value):     
66            self._cv_coverage.domainExtent = value
67
68    @property
69    def CRS(self):     
70        return self._cv_coverage.CRS
71
72    @CRS.setter
73    def CRS(self, value):       
74            self._cv_coverage.CRS = value
75
76    @property
77    def domainElement(self):   
78        return self._cv_coverage.domainElement
79
80    @domainElement.setter
81    def domainElement(self, value):     
82            self._cv_coverage.domainElement = value
83
84    @property
85    def commonPointRule(self): 
86        return self._cv_coverage.commonPointRule
87
88    @commonPointRule.setter
89    def commonPointRule(self, value):   
90            self._cv_coverage.commonPointRule = value
91
92    @property
93    def rangeType(self):       
94        return self._cv_coverage.rangeType
95
96    @rangeType.setter
97    def rangeType(self, value): 
98            self._cv_coverage.rangeType = value
99
100    @property
101    def element(self): 
102        ret = []
103        for item in self._element_cv_valuehexagon:
104            ret.append(item)
105        for item in self._element_cv_gridvaluecell:
106            ret.append(item)
107        for item in self._element_cv_valuecurve:
108            ret.append(item)
109        for item in self._element_cv_valuetriangle:
110            ret.append(item)
111        for item in self._element_cv_thiessenvaluepolygon:
112            ret.append(item)
113        return ret
114
115    @element.setter
116    def element(self, value):   
117        if isinstance(value, list):
118            self._element_cv_valuehexagon[:]
119            self._element_cv_gridvaluecell[:]
120            self._element_cv_valuecurve[:]
121            self._element_cv_valuetriangle[:]
122            self._element_cv_thiessenvaluepolygon[:]
123            for item in value:
124                valueClass = "%s.%s" % (type(item).__module__,type(item).__name__)
125                if valueClass == "ea_model.iso_19123_2005_coverages.coverages.hexagonal_grid.cv_valuehexagon.CV_ValueHexagon":
126                    self._element_cv_valuehexagon.append(item)
127                    continue
128                if valueClass == "ea_model.iso_19123_2005_coverages.coverages.quadrilateral_grid.cv_gridvaluecell.CV_GridValueCell":
129                    self._element_cv_gridvaluecell.append(item)
130                    continue
131                if valueClass == "ea_model.iso_19123_2005_coverages.coverages.segmented_curve.cv_valuecurve.CV_ValueCurve":
132                    self._element_cv_valuecurve.append(item)
133                    continue
134                if valueClass == "ea_model.iso_19123_2005_coverages.coverages.tin.cv_valuetriangle.CV_ValueTriangle":
135                    self._element_cv_valuetriangle.append(item)
136                    continue
137                if valueClass == "ea_model.iso_19123_2005_coverages.coverages.thiessen_polygon.cv_thiessenvaluepolygon.CV_ThiessenValuePolygon":
138                    self._element_cv_thiessenvaluepolygon.append(item)
139                    continue
140
141    @property
142    def rangeElement(self):     
143        return self._cv_coverage.rangeElement
144
145    @rangeElement.setter
146    def rangeElement(self, value):     
147            self._cv_coverage.rangeElement = value
148
149    def __key(self):
150        return (self.domainExtent, self.interpolationType, self.CRS, self.domainElement, self.commonPointRule, self.rangeType, self.element, self.rangeElement, self.interpolationParametersType)
151
152    def __eq__(self, y):
153        '''
154        Cannot compare classes which do not define a "__key" attribute
155        '''
156        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
157            return self.__key() == y.__key()
158        return id(self) == id(y)
159
160    def __hash__(self):
161        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.