Esempio n. 1
0
def updateDataSources(dbsession, database_params, vrt_target_dir, tmp_dir, cache_dir, logger, testing = True):   
    
    logger.info('Get georeference processing queue ...')
    processingQueue = getGeoreferenceProcessQueue(dbsession, logger)

    logger.info('Reset objects ...')
    for objectId in processingQueue['reset']:
        logger.info('Reset object with id %s ...'%objectId)
        resetMapObject(objectId, dbsession, logger, testing)
        
    logger.info('Update single georeferencing ...')
    for timestamp in processingQueue['georeference']:
        logger.info('Update timestamps %s ...'%timestamp)
        for georefProcess in processingQueue['georeference'][timestamp]:
            logger.info('Update georeferencing for objectid %s ...'%georefProcess.messtischblattid)
            processSingleGeorefProc(georefProcess, dbsession, logger, testing)
            logger.info('Calculating tms cache ...')
            messtischblatt = Messtischblatt.by_id(georefProcess.messtischblattid, dbsession)
            buildTsmCache(messtischblatt.verzeichnispfad, cache_dir, logger)
            
        logger.info('Recalculate virtualdataset ...')
        if not testing:
            dbsession.commit()
        
        updateVirtualdatasetForTimestamp('%s-01-01 00:00:00'%timestamp, vrt_target_dir, tmp_dir, database_params, dbsession, logger, testing=testing)
        
    logger.info('Finishing updating the single georeferencing ...')        
            
    return True
Esempio n. 2
0
    def testProcessUpdateProcessForTimestamp(self):
        response = updateVirtualdatasetForTimestamp('1868-01-01 00:00:00',
                                                    DBCONFIG_PARAMS,
                                                    self.dbsession,
                                                    self.logger,
                                                    testing=True)
        self.assertIsNone(response, 'Response is not "None" like expected.')

        response = updateVirtualdatasetForTimestamp('1900-01-01 00:00:00',
                                                    DBCONFIG_PARAMS,
                                                    self.dbsession,
                                                    self.logger,
                                                    testing=True)
        self.assertTrue(isinstance(response, str),
                        'Response is not a "string" like expected.')
Esempio n. 3
0
def updateDataSources(dbsession,
                      database_params,
                      vrt_target_dir,
                      tmp_dir,
                      cache_dir,
                      logger,
                      testing=True):

    logger.info('Get georeference processing queue ...')
    processingQueue = getGeoreferenceProcessQueue(dbsession, logger)

    logger.info('Reset objects ...')
    for objectId in processingQueue['reset']:
        logger.info('Reset object with id %s ...' % objectId)
        resetMapObject(objectId, dbsession, logger, testing)

    logger.info('Update single georeferencing ...')
    for timestamp in processingQueue['georeference']:
        logger.info('Update timestamps %s ...' % timestamp)
        for georefProcess in processingQueue['georeference'][timestamp]:
            logger.info('Update georeferencing for objectid %s ...' %
                        georefProcess.messtischblattid)
            processSingleGeorefProc(georefProcess, dbsession, logger, testing)
            logger.info('Calculating tms cache ...')
            messtischblatt = Messtischblatt.by_id(
                georefProcess.messtischblattid, dbsession)
            buildTsmCache(messtischblatt.verzeichnispfad, cache_dir, logger)

        logger.info('Recalculate virtualdataset ...')
        if not testing:
            dbsession.commit()

        updateVirtualdatasetForTimestamp('%s-01-01 00:00:00' % timestamp,
                                         vrt_target_dir,
                                         tmp_dir,
                                         database_params,
                                         dbsession,
                                         logger,
                                         testing=testing)

    logger.info('Finishing updating the single georeferencing ...')

    return True
 def testProcessUpdateProcessForTimestamp(self):
     response = updateVirtualdatasetForTimestamp('1868-01-01 00:00:00', DBCONFIG_PARAMS, self.dbsession, self.logger, testing=True)
     self.assertIsNone(response, 'Response is not "None" like expected.')
     
     response = updateVirtualdatasetForTimestamp('1900-01-01 00:00:00', DBCONFIG_PARAMS, self.dbsession, self.logger, testing=True)
     self.assertTrue(isinstance(response, str), 'Response is not a "string" like expected.')