Exemple #1
0
    def create(self):
        self.t0 = time.time()

        tilecount.value = 0
        skipcount.value = 0

        tiles = TerrainTiles(self.dbConfigFile, self.tmsConfig, self.t0)
        procfactor = int(self.tmsConfig.get('General', 'procfactor'))

        pm = PoolManager(logger=logger, factor=procfactor)

        maxChunks = int(self.tmsConfig.get('General', 'maxChunks'))

        nbTiles = self.numOfTiles()
        tilesPerProc = int(nbTiles / pm.numOfProcesses())
        if tilesPerProc < maxChunks:
            maxChunks = tilesPerProc
        if maxChunks < 1:
            maxChunks = 1

        logger.info('Starting creation of %s tiles (%s per chunk)' % (
            nbTiles, maxChunks))
        pm.process(tiles, createTile, maxChunks)

        tend = time.time()
        logger.info('It took %s to create %s tiles (%s were skipped)' % (
            str(datetime.timedelta(seconds=tend - self.t0)), tilecount.value,
            skipcount.value
        ))
Exemple #2
0
    def create(self):
        self.t0 = time.time()

        tilecount.value = 0
        skipcount.value = 0

        tiles = TerrainTiles(self.dbConfigFile, self.tmsConfig, self.t0)
        procfactor = int(self.tmsConfig.get('General', 'procfactor'))

        pm = PoolManager(logger=logger, factor=procfactor)

        maxChunks = int(self.tmsConfig.get('General', 'maxChunks'))

        nbTiles = self.numOfTiles()
        tilesPerProc = int(nbTiles / pm.numOfProcesses())
        if tilesPerProc < maxChunks:
            maxChunks = tilesPerProc
        if maxChunks < 1:
            maxChunks = 1

        logger.info('Starting creation of %s tiles (%s per chunk)' %
                    (nbTiles, maxChunks))
        pm.process(tiles, createTile, maxChunks)

        tend = time.time()
        logger.info('It took %s to create %s tiles (%s were skipped)' %
                    (str(datetime.timedelta(seconds=tend - self.t0)),
                     tilecount.value, skipcount.value))
Exemple #3
0
    def createTiles(self):
        tilecount.value = 0
        skipcount.value = 0
        queueName = self.tmsConfig.get("General", "sqsqueue")
        self.t0 = time.time()
        if len(queueName) <= 0:
            logger.error("Missing queueName")
            return
        procfactor = int(self.tmsConfig.get("General", "procfactor"))

        pm = PoolManager(logger=logger, factor=procfactor)
        qtiles = QueueTiles(queueName, self.dbConfigFile, self.t0, pm.numOfProcesses())

        logger.info("Starting creation of tiles from queue %s " % (queueName))
        pm.process(qtiles, createTileFromQueue, 1)
        tend = time.time()
        logger.info(
            "It took %s to create %s tiles (%s were skipped) from queue"
            % (str(datetime.timedelta(seconds=tend - self.t0)), tilecount.value, skipcount.value)
        )
Exemple #4
0
    def createTiles(self):
        tilecount.value = 0
        skipcount.value = 0
        queueName = self.tmsConfig.get('General', 'sqsqueue')
        self.t0 = time.time()
        if len(queueName) <= 0:
            logger.error('Missing queueName')
            return
        procfactor = int(self.tmsConfig.get('General', 'procfactor'))

        pm = PoolManager(logger=logger, factor=procfactor)
        qtiles = QueueTerrainTiles(queueName,
                                   self.dbConfigFile, self.tmsConfig, self.t0,
                                   pm.numOfProcesses())

        logger.info('Starting creation of tiles from queue %s ' % (queueName))
        pm.process(qtiles, createTileFromQueue, 1)
        tend = time.time()
        logger.info(
            'It took %s to create %s tiles (%s were skipped) from queue' %
            (str(datetime.timedelta(seconds=tend - self.t0)), tilecount.value,
             skipcount.value))