source: mauRepo/MolesManager/trunk/src/ea_model/iso_19123_2005_coverages/coverages/quadrilateral_grid/cv_referenceablegrid.py @ 8091

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19123_2005_coverages/coverages/quadrilateral_grid/cv_referenceablegrid.py@8091
Revision 8091, 3.2 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.quadrilateral_grid.cv_grid import  CV_Grid
22from ascore.utils import has_value
23
24'''
25Created on 16-Feb-2012 16:18:05
26
27@author: mnagni
28'''
29
30class CV_ReferenceableGrid(CV_Grid):
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_grid = CV_Grid()       
43
44        self._crs_sc_singlecrs = []
45        self._crs_sc_compoundcrs = []
46        self.cell = []
47        self.dimension = None
48        self.intersection = []
49        self.axisNames = []
50        self.extent = None
51        super(CV_ReferenceableGrid, self).__init__()
52
53    @property
54    def crs(self):     
55        ret = []
56        for item in self._crs_sc_singlecrs:
57            ret.append(item)
58        for item in self._crs_sc_compoundcrs:
59            ret.append(item)
60        return ret
61
62    @crs.setter
63    def crs(self, value):       
64        if isinstance(value, list):
65            self._crs_sc_singlecrs[:]
66            self._crs_sc_compoundcrs[:]
67            for item in value:
68                valueClass = "%s.%s" % (type(item).__module__,type(item).__name__)
69                if valueClass == "ea_model.iso_19111_referencing_by_coordinates.coordinate_reference_systems.sc_singlecrs.SC_SingleCRS":
70                    self._crs_sc_singlecrs.append(item)
71                    continue
72                if valueClass == "ea_model.iso_19111_referencing_by_coordinates.coordinate_reference_systems.sc_compoundcrs.SC_CompoundCRS":
73                    self._crs_sc_compoundcrs.append(item)
74                    continue
75
76    @property
77    def cell(self):     
78        return self._cv_grid.cell
79
80    @cell.setter
81    def cell(self, value):     
82            self._cv_grid.cell = value
83
84    @property
85    def dimension(self):       
86        return self._cv_grid.dimension
87
88    @dimension.setter
89    def dimension(self, value): 
90            self._cv_grid.dimension = value
91
92    @property
93    def intersection(self):     
94        return self._cv_grid.intersection
95
96    @intersection.setter
97    def intersection(self, value):     
98            self._cv_grid.intersection = value
99
100    @property
101    def axisNames(self):       
102        return self._cv_grid.axisNames
103
104    @axisNames.setter
105    def axisNames(self, value): 
106            self._cv_grid.axisNames = value
107
108    @property
109    def extent(self):   
110        return self._cv_grid.extent
111
112    @extent.setter
113    def extent(self, value):   
114            self._cv_grid.extent = value
115
116    def __key(self):
117        return (self.crs, self.cell, self.dimension, self.intersection, self.axisNames, self.extent)
118
119    def __eq__(self, y):
120        '''
121        Cannot compare classes which do not define a "__key" attribute
122        '''
123        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
124            return self.__key() == y.__key()
125        return id(self) == id(y)
126
127    def __hash__(self):
128        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.