Ignore:
Timestamp:
27/06/12 16:41:44 (7 years ago)
Author:
mnagni
Message:

Incomplete - # 22488: CEDA Observation Collection - Geographical Extent
 http://team.ceda.ac.uk/trac/ceda/ticket/22488

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/MolesManager/moles3epb.py

    r8409 r8416  
    4141from ea_model.iso_19115_2006_metadata_corrigendum.citation_and_responsible_party_information.ci_citation import CI_Citation 
    4242from ea_model.iso_19115_2006_metadata_corrigendum.extent_information.ex_geographicboundingbox import EX_GeographicBoundingBox 
    43 from libs.postgisutil import unifyGeometries, create_st_setSRID 
     43from libs.postgisutil import unifyGeometries, create_st_setSRID, getBox2D,\ 
     44    unifyGeometriesAsBBox 
    4445from ea_model.ceda_metadatamodel.ceda_observationcollection.ceda_observationcollection import CEDA_ObservationCollection 
    4546from ea_model.ceda_metadatamodel.ceda_observation.ceda_observation import CEDA_Observation 
     
    113114    def updateCedaObject(self, ceda_object, cols_to_update): 
    114115        """ 
    115             Update and eventually commit a CEDA Object in MOLES3 db.  
     116            Update, eventually add to the session, and commit a CEDA Object in MOLES3 db.  
    116117            @param ceda_object: the CEDA object to update 
    117118            @param cols_to_update: a dictionary containing the columns to update for the given ceda_object and the desired value. 
     
    121122        coll = None 
    122123        try: 
    123             coll = self._session.merge(ceda_object) 
     124            if ceda_object in self._session: 
     125                coll = self._session.merge(ceda_object) 
     126            else: 
     127                self._session.add(ceda_object) 
     128                coll = ceda_object    
    124129        except Exception as e: 
    125130            print e 
     
    157162                           ge.eastBoundLongitude, ge.northBoundLatitude) 
    158163        return None 
    159      
    160      
    161      
    162     def getUnifyObservationCollectionGE(self, collection): 
     164 
     165    def getUnifyObservationCollectionGEAsBBox(self, collection): 
    163166        """ 
    164167            Returns the union of the collections.member'a  GeographicExtension(s) 
     
    170173                bboxes.append(self.getGeograpicExtentGeometry(ge)) 
    171174         
    172         return unifyGeometries(bboxes, self)   
     175        return unifyGeometriesAsBBox(bboxes, self)   
     176         
    173177 
    174178    def retrieveGUIDFromInstance(self, instance): 
Note: See TracChangeset for help on using the changeset viewer.