Changeset 4908 for TI01-discovery


Ignore:
Timestamp:
05/02/09 15:42:12 (11 years ago)
Author:
sdonegan
Message:

Properly handle difs with no spatial data

Location:
TI01-discovery/tags/stable-TI01-ingestAutomation_Proglue_upgradesAndReporting/temp/OAIBatch
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/tags/stable-TI01-ingestAutomation_Proglue_upgradesAndReporting/temp/OAIBatch/PostgresDAO.py

    r4888 r4908  
    166166            str(coords.north) + ", " + str(coords.south) + ", " + str(coords.west) + ", " + \ 
    167167            str(coords.east) + ", " 
    168              
    169              
     168                     
    170169         
    171170        # cope with null dates appropriately 
     
    182181        sqlCmd += ");"  
    183182         
    184         logging.info("sssssssssssssssssssssssssssssssssssssssss" + sqlCmd) 
    185  
    186183        db_funcs.runSQLCommand(self._connection, sqlCmd) 
    187184        logging.info("Spatiotemporal row added successfully") 
     
    201198        try: 
    202199            timeData = self._record.getTemporalData()  
     200        except:             
     201            timeData = [ TimeRange('null', 'null') ] 
     202             
     203        try: 
     204            spatialData = self._record.getSpatialData() 
    203205        except: 
    204              
    205             timeData = [ TimeRange('null', 'null') ] 
    206              
    207         spatialData = self._record.getSpatialData() 
     206            print "doobt" 
    208207                 
    209208        # check if we have any spatiotemporal data to add; escape if not 
    210         if not timeData and not spatialData: 
     209        if not timeData and not spatialData:            
    211210            logging.info("No spatiotemporal data found for record - skipping") 
    212211            return 
  • TI01-discovery/tags/stable-TI01-ingestAutomation_Proglue_upgradesAndReporting/temp/OAIBatch/PostgresRecord.py

    r4888 r4908  
    328328        @return: TimeRange object array with temporal data 
    329329        ''' 
    330          
     330        
    331331        if self.stData is None: 
    332332             
     
    342342        @return: Coords object array with spatial data 
    343343        ''' 
    344         if self.stData is None: 
     344        
     345        if self.stData is None:            
    345346            self.getSpatioTemporalData() 
    346347         
     
    366367        ''' 
    367368         
    368         
    369369        logging.info('Retrieving spatiotemporal info from moles file') 
    370370        # initialise the various spatiotemporal arrays used to extract data to 
    371371        self.stData = SpatioTemporalData() 
    372          
    373         logging.info('ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg : ' + self.stData) 
    374372         
    375373        if self.dgMeta is None: 
     
    533531        ''' 
    534532        logging.info("Extracting bounding box info") 
    535         try: 
    536  
    537             
     533        print "Extracting bounding box info"  
     534         
     535        try: 
     536 
    538537            bboxes = dgMeta.dgMetadataRecord.dgDataEntity.dgDataSummary.dgDataCoverage.dgSpatialCoverage.BoundingBox 
    539538             
    540             if not bboxes: 
    541                 logging.info("No bounding box info found for document") 
    542                 return 
    543             
    544539            bbox_list=self.listify(bboxes) 
     540             
    545541            #parse the list of coordinates 
    546542            for bbox in bbox_list: 
     
    552548                logging.info("Spatial info: west= " + west + ",south " + south + ", east " + \ 
    553549                    east + ", north " + north + "") 
    554                  
    555         except Exception, detail: 
     550         
     551        except Exception, detail: 
     552             
     553            logging.info("No bounding box info found for document") 
    556554            logging.warning("Problem encountered whilst parsing bounding box info - this may lead \n" + \ 
    557                             "to an incomplete set of metadata being ingested. \nDetail: %s" %detail) 
     555                            "to an incomplete set of metadata being ingested. \nDetail: %s" %detail)                 
     556            return 
     557            
     558 
    558559 
    559560 
  • TI01-discovery/tags/stable-TI01-ingestAutomation_Proglue_upgradesAndReporting/temp/OAIBatch/geoUtilities.py

    r3800 r4908  
    2525                } 
    2626        #try: 
     27         
     28     
    2729        North=getter(elem,match[entity]['North']) 
    2830        South=getter(elem,match[entity]['South']) 
Note: See TracChangeset for help on using the changeset viewer.