source: mauRepo/MolesManager/trunk/src/ea_model/iso_19156_2011_observations_and_measurements/sampling_features/spatialsamplingfeature/sf_spatialsamplingfeature.py @ 8091

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19156_2011_observations_and_measurements/sampling_features/spatialsamplingfeature/sf_spatialsamplingfeature.py@8091
Revision 8091, 7.7 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_19156_2011_observations_and_measurements.sampling_features.samplingfeature.sf_samplingfeature import  SF_SamplingFeature
22from ascore.utils import has_value
23
24'''
25Created on 16-Feb-2012 16:18:10
26
27@author: mnagni
28'''
29
30class SF_SpatialSamplingFeature(SF_SamplingFeature):
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._sf_samplingfeature = SF_SamplingFeature()         
43
44        self._relatedObservation_om_discretecoverageobservation = []
45        self._relatedObservation_om_temporalobservation = []
46        self._relatedObservation_om_measurement = []
47        self._relatedObservation_mo_observation = []
48        self._relatedObservation_om_truthobservation = []
49        self._relatedObservation_om_countobservation = []
50        self._relatedObservation_om_categoryobservation = []
51        self._relatedObservation_om_geometryobservation = []
52        self._relatedObservation_om_complexobservation = []
53        self.lineage = None
54        self._relatedSamplingFeature_sf_spatialsamplingfeature = []
55        self._relatedSamplingFeature_sf_specimen = []
56        self._propertyValueProvider_om_discretecoverageobservation = []
57        self._propertyValueProvider_om_temporalobservation = []
58        self._propertyValueProvider_om_measurement = []
59        self._propertyValueProvider_mo_observation = []
60        self._propertyValueProvider_om_truthobservation = []
61        self._propertyValueProvider_om_countobservation = []
62        self._propertyValueProvider_om_categoryobservation = []
63        self._propertyValueProvider_om_geometryobservation = []
64        self._propertyValueProvider_om_complexobservation = []
65        self._positionalAccuracy_dq_griddeddatapositionalaccuracy = []
66        self._positionalAccuracy_dq_relativeinternalpositionalaccuracy = []
67        self._positionalAccuracy_dq_absoluteexternalpositionalaccuracy = []
68        self.sampledFeature = []
69        self._sampledFeature_sf_samplingfeature = []
70        self._sampledFeature_mo_featureofinterest = []
71        self._sampledFeature_gfi_domainfeature = []
72        self._shape_gm_complex = None
73        self._shape_gm_primitive = None
74        self._shape_gm_aggregate = None
75        self.hostedProcedure = []
76        self.parameter = []
77        super(SF_SpatialSamplingFeature, self).__init__()
78
79    @property
80    def relatedObservation(self):       
81        return self._sf_samplingfeature.relatedObservation
82
83    @relatedObservation.setter
84    def relatedObservation(self, value):       
85            self._sf_samplingfeature.relatedObservation = value
86
87    @property
88    def lineage(self): 
89        return self._sf_samplingfeature.lineage
90
91    @lineage.setter
92    def lineage(self, value):   
93            self._sf_samplingfeature.lineage = value
94
95    @property
96    def relatedSamplingFeature(self):   
97        return self._sf_samplingfeature.relatedSamplingFeature
98
99    @relatedSamplingFeature.setter
100    def relatedSamplingFeature(self, value):   
101            self._sf_samplingfeature.relatedSamplingFeature = value
102
103    @property
104    def propertyValueProvider(self):   
105        return self._sf_samplingfeature.propertyValueProvider
106
107    @propertyValueProvider.setter
108    def propertyValueProvider(self, value):     
109            self._sf_samplingfeature.propertyValueProvider = value
110
111    @property
112    def positionalAccuracy(self):       
113        ret = []
114        for item in self._positionalAccuracy_dq_griddeddatapositionalaccuracy:
115            ret.append(item)
116        for item in self._positionalAccuracy_dq_relativeinternalpositionalaccuracy:
117            ret.append(item)
118        for item in self._positionalAccuracy_dq_absoluteexternalpositionalaccuracy:
119            ret.append(item)
120        return ret
121
122    @positionalAccuracy.setter
123    def positionalAccuracy(self, value):       
124        if isinstance(value, list):
125            self._positionalAccuracy_dq_griddeddatapositionalaccuracy[:]
126            self._positionalAccuracy_dq_relativeinternalpositionalaccuracy[:]
127            self._positionalAccuracy_dq_absoluteexternalpositionalaccuracy[:]
128            for item in value:
129                valueClass = "%s.%s" % (type(item).__module__,type(item).__name__)
130                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.data_quality_information.dq_griddeddatapositionalaccuracy.DQ_GriddedDataPositionalAccuracy":
131                    self._positionalAccuracy_dq_griddeddatapositionalaccuracy.append(item)
132                    continue
133                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.data_quality_information.dq_relativeinternalpositionalaccuracy.DQ_RelativeInternalPositionalAccuracy":
134                    self._positionalAccuracy_dq_relativeinternalpositionalaccuracy.append(item)
135                    continue
136                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.data_quality_information.dq_absoluteexternalpositionalaccuracy.DQ_AbsoluteExternalPositionalAccuracy":
137                    self._positionalAccuracy_dq_absoluteexternalpositionalaccuracy.append(item)
138                    continue
139
140    @property
141    def sampledFeature(self):   
142        return self._sf_samplingfeature.sampledFeature
143
144    @sampledFeature.setter
145    def sampledFeature(self, value):   
146            self._sf_samplingfeature.sampledFeature = value
147
148    @property
149    def sampledFeature(self):   
150        return self._sf_samplingfeature.sampledFeature
151
152    @sampledFeature.setter
153    def sampledFeature(self, value):   
154            self._sf_samplingfeature.sampledFeature = value
155
156    @property
157    def shape(self):   
158        if(has_value(self._shape_gm_complex)):
159            return self._shape_gm_complex
160        if(has_value(self._shape_gm_primitive)):
161            return self._shape_gm_primitive
162        if(has_value(self._shape_gm_aggregate)):
163            return self._shape_gm_aggregate
164        return  None
165
166    @shape.setter
167    def shape(self, value):     
168        valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
169        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_complex.gm_complex.GM_Complex":
170            self._shape_gm_complex = value
171            self._shape_gm_primitive = None
172            self._shape_gm_aggregate = None
173        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_primitive.gm_primitive.GM_Primitive":
174            self._shape_gm_primitive = value
175            self._shape_gm_complex = None
176            self._shape_gm_aggregate = None
177        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_aggregates.gm_aggregate.GM_Aggregate":
178            self._shape_gm_aggregate = value
179            self._shape_gm_complex = None
180            self._shape_gm_primitive = None
181
182    @property
183    def parameter(self):       
184        return self._sf_samplingfeature.parameter
185
186    @parameter.setter
187    def parameter(self, value): 
188            self._sf_samplingfeature.parameter = value
189
190    def __key(self):
191        return (self.relatedObservation, self.lineage, self.relatedSamplingFeature, self.propertyValueProvider, self.positionalAccuracy, self.sampledFeature, self.sampledFeature, self.shape, self.hostedProcedure, self.parameter)
192
193    def __eq__(self, y):
194        '''
195        Cannot compare classes which do not define a "__key" attribute
196        '''
197        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
198            return self.__key() == y.__key()
199        return id(self) == id(y)
200
201    def __hash__(self):
202        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.