source: mauRepo/MolesManager/trunk/src/ea_model/iso_19111_referencing_by_coordinates/coordinate_operations/cc_coordinateoperation.py @ 8091

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19111_referencing_by_coordinates/coordinate_operations/cc_coordinateoperation.py@8091
Revision 8091, 6.4 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_19111_referencing_by_coordinates.identified_objects.io_identifiedobject import  IO_IdentifiedObject
22from ascore.utils import has_value
23
24'''
25Created on 16-Feb-2012 16:18:09
26
27@author: mnagni
28'''
29
30class CC_CoordinateOperation(IO_IdentifiedObject):
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._io_identifiedobject = IO_IdentifiedObject()       
43
44        self.identifier = []
45        self.name = None
46        self.domainOfValidity = None
47        self.concatOperation = []
48        self.remarks = None
49        self._coordinateOperationAccuracy_dq_griddeddatapositionalaccuracy = []
50        self._coordinateOperationAccuracy_dq_relativeinternalpositionalaccuracy = []
51        self._coordinateOperationAccuracy_dq_absoluteexternalpositionalaccuracy = []
52        self.alias = []
53        self.scope = []
54        self.operationVersion = None
55        self._targetCRS_sc_singlecrs = None
56        self._targetCRS_sc_compoundcrs = None
57        self.passThruOperation = []
58        self._sourceCRS_sc_singlecrs = None
59        self._sourceCRS_sc_compoundcrs = None
60        super(CC_CoordinateOperation, self).__init__()
61
62    @property
63    def identifier(self):       
64        return self._io_identifiedobject.identifier
65
66    @identifier.setter
67    def identifier(self, value):       
68            self._io_identifiedobject.identifier = value
69
70    @property
71    def name(self):     
72        return self._io_identifiedobject.name
73
74    @name.setter
75    def name(self, value):     
76            self._io_identifiedobject.name = value
77
78    @property
79    def remarks(self): 
80        return self._io_identifiedobject.remarks
81
82    @remarks.setter
83    def remarks(self, value):   
84            self._io_identifiedobject.remarks = value
85
86    @property
87    def coordinateOperationAccuracy(self):     
88        ret = []
89        for item in self._coordinateOperationAccuracy_dq_griddeddatapositionalaccuracy:
90            ret.append(item)
91        for item in self._coordinateOperationAccuracy_dq_relativeinternalpositionalaccuracy:
92            ret.append(item)
93        for item in self._coordinateOperationAccuracy_dq_absoluteexternalpositionalaccuracy:
94            ret.append(item)
95        return ret
96
97    @coordinateOperationAccuracy.setter
98    def coordinateOperationAccuracy(self, value):       
99        if isinstance(value, list):
100            self._coordinateOperationAccuracy_dq_griddeddatapositionalaccuracy[:]
101            self._coordinateOperationAccuracy_dq_relativeinternalpositionalaccuracy[:]
102            self._coordinateOperationAccuracy_dq_absoluteexternalpositionalaccuracy[:]
103            for item in value:
104                valueClass = "%s.%s" % (type(item).__module__,type(item).__name__)
105                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.data_quality_information.dq_griddeddatapositionalaccuracy.DQ_GriddedDataPositionalAccuracy":
106                    self._coordinateOperationAccuracy_dq_griddeddatapositionalaccuracy.append(item)
107                    continue
108                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.data_quality_information.dq_relativeinternalpositionalaccuracy.DQ_RelativeInternalPositionalAccuracy":
109                    self._coordinateOperationAccuracy_dq_relativeinternalpositionalaccuracy.append(item)
110                    continue
111                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.data_quality_information.dq_absoluteexternalpositionalaccuracy.DQ_AbsoluteExternalPositionalAccuracy":
112                    self._coordinateOperationAccuracy_dq_absoluteexternalpositionalaccuracy.append(item)
113                    continue
114
115    @property
116    def alias(self):   
117        return self._io_identifiedobject.alias
118
119    @alias.setter
120    def alias(self, value):     
121            self._io_identifiedobject.alias = value
122
123    @property
124    def targetCRS(self):       
125        if(has_value(self._targetCRS_sc_singlecrs)):
126            return self._targetCRS_sc_singlecrs
127        if(has_value(self._targetCRS_sc_compoundcrs)):
128            return self._targetCRS_sc_compoundcrs
129        return  None
130
131    @targetCRS.setter
132    def targetCRS(self, value): 
133        valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
134        if valueClass == "ea_model.iso_19111_referencing_by_coordinates.coordinate_reference_systems.sc_singlecrs.SC_SingleCRS":
135            self._targetCRS_sc_singlecrs = value
136            self._targetCRS_sc_compoundcrs = None
137        if valueClass == "ea_model.iso_19111_referencing_by_coordinates.coordinate_reference_systems.sc_compoundcrs.SC_CompoundCRS":
138            self._targetCRS_sc_compoundcrs = value
139            self._targetCRS_sc_singlecrs = None
140
141    @property
142    def sourceCRS(self):       
143        if(has_value(self._sourceCRS_sc_singlecrs)):
144            return self._sourceCRS_sc_singlecrs
145        if(has_value(self._sourceCRS_sc_compoundcrs)):
146            return self._sourceCRS_sc_compoundcrs
147        return  None
148
149    @sourceCRS.setter
150    def sourceCRS(self, value): 
151        valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
152        if valueClass == "ea_model.iso_19111_referencing_by_coordinates.coordinate_reference_systems.sc_singlecrs.SC_SingleCRS":
153            self._sourceCRS_sc_singlecrs = value
154            self._sourceCRS_sc_compoundcrs = None
155        if valueClass == "ea_model.iso_19111_referencing_by_coordinates.coordinate_reference_systems.sc_compoundcrs.SC_CompoundCRS":
156            self._sourceCRS_sc_compoundcrs = value
157            self._sourceCRS_sc_singlecrs = None
158
159    def __key(self):
160        return (self.identifier, self.name, self.domainOfValidity, self.concatOperation, self.remarks, self.coordinateOperationAccuracy, self.alias, self.scope, self.operationVersion, self.targetCRS, self.passThruOperation, self.sourceCRS)
161
162    def __eq__(self, y):
163        '''
164        Cannot compare classes which do not define a "__key" attribute
165        '''
166        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
167            return self.__key() == y.__key()
168        return id(self) == id(y)
169
170    def __hash__(self):
171        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.