source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19112_location_by_identifier/referencesystem_by_identifier/si_spatialreferencesystemusinggeographicidentifiers.py @ 8457

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19112_location_by_identifier/referencesystem_by_identifier/si_spatialreferencesystemusinggeographicidentifiers.py@8457
Revision 8457, 3.4 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_19111_referencing_by_coordinates.reference_systems.rs_referencesystem import  RS_ReferenceSystem
22from ascore.utils import has_value, collectionProofHash
23
24'''
25Created on 10-Jul-2012 14:15:08
26
27@author: mnagni
28'''
29
30class SI_SpatialReferenceSystemUsingGeographicIdentifiers(RS_ReferenceSystem):
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._rs_referencesystem = RS_ReferenceSystem()         
43
44                self.name = None
45                self.locationTypes = []
46                self.domainOfValidity = None
47                self.overallOwner = None
48                self._territoryOfUse_ex_geographicdescription = None
49                self._territoryOfUse_ex_geographicboundingbox = None
50                self._territoryOfUse_ex_boundingpolygon = None
51                self._territoryOfUse = None
52                self.theme = None
53                super(SI_SpatialReferenceSystemUsingGeographicIdentifiers, self).__init__()
54        @property
55        def name(self):
56                return self._rs_referencesystem.name
57
58        @name.setter
59        def name(self, value): 
60                        self._rs_referencesystem.name = value
61        @property
62        def domainOfValidity(self):     
63                return self._rs_referencesystem.domainOfValidity
64
65        @domainOfValidity.setter
66        def domainOfValidity(self, value):     
67                        self._rs_referencesystem.domainOfValidity = value
68        @property
69        def territoryOfUse(self):       
70                if(has_value(self._territoryOfUse_ex_geographicdescription)):
71                        return self._territoryOfUse_ex_geographicdescription
72                if(has_value(self._territoryOfUse_ex_geographicboundingbox)):
73                        return self._territoryOfUse_ex_geographicboundingbox
74                if(has_value(self._territoryOfUse_ex_boundingpolygon)):
75                        return self._territoryOfUse_ex_boundingpolygon
76                return  None
77
78        @territoryOfUse.setter
79        def territoryOfUse(self, value):       
80                valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
81                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.extent_information.ex_geographicdescription.EX_GeographicDescription":
82                        self._territoryOfUse_ex_geographicdescription = value
83                        self._territoryOfUse_ex_geographicboundingbox = None
84                        self._territoryOfUse_ex_boundingpolygon = None
85                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.extent_information.ex_geographicboundingbox.EX_GeographicBoundingBox":
86                        self._territoryOfUse_ex_geographicboundingbox = value
87                        self._territoryOfUse_ex_geographicdescription = None
88                        self._territoryOfUse_ex_boundingpolygon = None
89                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.extent_information.ex_boundingpolygon.EX_BoundingPolygon":
90                        self._territoryOfUse_ex_boundingpolygon = value
91                        self._territoryOfUse_ex_geographicdescription = None
92                        self._territoryOfUse_ex_geographicboundingbox = None
93
94        def synchronize(self):
95                pass
96
97        def __key(self):
98                return (self.name, self.locationTypes, self.domainOfValidity, self.overallOwner, self.territoryOfUse, self.theme)
99
100        def __eq__(self, y):
101                if type(self) != type(y):
102                        return False
103                '''
104                Cannot compare classes which do not define a "__key" attribute
105                '''
106                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
107                        return self.__key() == y.__key()
108                return id(self) == id(y)
109
110        def __hash__(self):
111                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.