source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19115_2_2009_metadata___imagery/spatial_representation_information___imagery/mi_georeferenceable.py @ 8457

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19115_2_2009_metadata___imagery/spatial_representation_information___imagery/mi_georeferenceable.py@8457
Revision 8457, 5.3 KB checked in by mnagni, 7 years ago (diff)

Corrected an error in the generation of the classes "synchronize" method.

  • Property svn:mime-type set to text/plain
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_19115_2006_metadata_corrigendum.spatial_representation_information.md_georeferenceable import  MD_Georeferenceable
22from ascore.utils import has_value, collectionProofHash
23
24'''
25Created on 10-Jul-2012 14:15:07
26
27@author: mnagni
28'''
29
30class MI_Georeferenceable(MD_Georeferenceable):
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._md_georeferenceable = MD_Georeferenceable()       
43
44                self.platformParameters = None
45                self.transformationParameterAvailability = None
46                self.orientationParameterDescription = None
47                self.orientationParameterAvailability = None
48                self.georeferencedParameters = None
49                self._geolocationInformation_mi_gcpcollection = []
50                self._geolocationInformation_sd_sensormodel = []
51                self._geolocationInformation = []
52                self.cellGeometry = None
53                self.numberOfDimensions = None
54                self.controlPointAvailability = None
55                super(MI_Georeferenceable, self).__init__()
56        @property
57        def transformationParameterAvailability(self): 
58                return self._md_georeferenceable.transformationParameterAvailability
59
60        @transformationParameterAvailability.setter
61        def transformationParameterAvailability(self, value):   
62                        self._md_georeferenceable.transformationParameterAvailability = value
63        @property
64        def orientationParameterDescription(self):     
65                return self._md_georeferenceable.orientationParameterDescription
66
67        @orientationParameterDescription.setter
68        def orientationParameterDescription(self, value):       
69                        self._md_georeferenceable.orientationParameterDescription = value
70        @property
71        def orientationParameterAvailability(self):     
72                return self._md_georeferenceable.orientationParameterAvailability
73
74        @orientationParameterAvailability.setter
75        def orientationParameterAvailability(self, value):     
76                        self._md_georeferenceable.orientationParameterAvailability = value
77        @property
78        def georeferencedParameters(self):     
79                return self._md_georeferenceable.georeferencedParameters
80
81        @georeferencedParameters.setter
82        def georeferencedParameters(self, value):       
83                        self._md_georeferenceable.georeferencedParameters = value
84        @property
85        def parameterCitation(self):   
86                return self._md_georeferenceable.parameterCitation
87
88        @parameterCitation.setter
89        def parameterCitation(self, value):     
90                        self._md_georeferenceable.parameterCitation = value
91        @property
92        def geolocationInformation(self):       
93                try:
94                        ret = []
95                        ret.extend(self._geolocationInformation_mi_gcpcollection)
96                        ret.extend(self._geolocationInformation_sd_sensormodel)
97                        if not hasattr(self, '_geolocationInformation'):
98                                self._geolocationInformation = []
99                        if self._geolocationInformation is not None:
100                                ret.extend(self._geolocationInformation)
101                        del self._geolocationInformation[:]
102                        self._geolocationInformation.extend(set(ret))
103                except Exception as e:
104                        pass
105                return self._geolocationInformation
106
107        @property
108        def cellGeometry(self):
109                return self._md_georeferenceable.cellGeometry
110
111        @cellGeometry.setter
112        def cellGeometry(self, value): 
113                        self._md_georeferenceable.cellGeometry = value
114        @property
115        def axisDimensionProperties(self):     
116                return self._md_georeferenceable.axisDimensionProperties
117
118        @axisDimensionProperties.setter
119        def axisDimensionProperties(self, value):       
120                        self._md_georeferenceable.axisDimensionProperties = value
121        @property
122        def numberOfDimensions(self):   
123                return self._md_georeferenceable.numberOfDimensions
124
125        @numberOfDimensions.setter
126        def numberOfDimensions(self, value):   
127                        self._md_georeferenceable.numberOfDimensions = value
128        @property
129        def controlPointAvailability(self):     
130                return self._md_georeferenceable.controlPointAvailability
131
132        @controlPointAvailability.setter
133        def controlPointAvailability(self, value):     
134                        self._md_georeferenceable.controlPointAvailability = value
135
136        def synchronize(self):
137                int_geolocationInformation = self.geolocationInformation       
138                del self._geolocationInformation_mi_gcpcollection[:]
139                del self._geolocationInformation_sd_sensormodel[:]
140                for item in int_geolocationInformation:
141                        valueClass = "%s.%s" % (type(item).__module__,type(item).__name__)
142                        if valueClass == "ea_model.iso_19115_2_2009_metadata___imagery.spatial_representation_information___imagery.mi_gcpcollection.MI_GCPCollection":
143                                self._geolocationInformation_mi_gcpcollection.append(item)
144                                continue
145                        if valueClass == "ea_model.iso_19130_sensor_data.sensor_model.sd_sensormodel.SD_SensorModel":
146                                self._geolocationInformation_sd_sensormodel.append(item)
147                                continue
148                pass
149
150        def __key(self):
151                return (self.platformParameters, self.transformationParameterAvailability, self.orientationParameterDescription, self.orientationParameterAvailability, self.georeferencedParameters, self.parameterCitation, self.geolocationInformation, self.cellGeometry, self.axisDimensionProperties, self.numberOfDimensions, self.controlPointAvailability)
152
153        def __eq__(self, y):
154                if type(self) != type(y):
155                        return False
156                '''
157                Cannot compare classes which do not define a "__key" attribute
158                '''
159                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
160                        return self.__key() == y.__key()
161                return id(self) == id(y)
162
163        def __hash__(self):
164                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.