(self, tiles_with_encoded_data)
return tiles
Decodes the PBF data from all the specified tiles and reports the progress
         * If a tile is loaded from the cache, the decoded_data is already set and doesn't have to be encoded
        :param tiles_with_encoded_data:
        :return:
Decodes the PBF data from all the specified tiles and reports the progress
         * If a tile is loaded from the cache, the decoded_data is already set and doesn't have to be encoded
        :param tiles_with_encoded_data:
        :return:
Decodes the PBF data from all the specified tiles and reports the progress * If a tile is loaded from the cache the decoded_data is already set and doesn t have to be encoded : param tiles_with_encoded_data : : return :
def _decode_tiles(self, tiles_with_encoded_data):
        """
        Decodes the PBF data from all the specified tiles and reports the progress
         * If a tile is loaded from the cache, the decoded_data is already set and doesn't have to be encoded
        :param tiles_with_encoded_data:
        :return:
        """
        clip_tiles = not self._loading_options["inspection_mode"]

        if self.native_decoding_supported:
            decoder_func = decode_tile_native
        else:
            decoder_func = decode_tile_python

        tiles_with_encoded_data: List[Tuple] = [(t[0], self._unzip(t[1]), clip_tiles) for t in tiles_with_encoded_data]
        tile_data_tuples: List[Tuple] = []

        if len(tiles_with_encoded_data) <= self._nr_tiles_to_process_serial:
            for t in tiles_with_encoded_data:
                tile, decoded_data = decoder_func(t)
                if decoded_data:
                    tile_data_tuples.append((tile, decoded_data))
        else:

            def raise_error(e):
                raise e

            info("Processing tiles in parallel...")
            pool = self._get_pool()
            rs = pool.map_async(
                func=decoder_func,
                iterable=tiles_with_encoded_data,
                callback=tile_data_tuples.extend,
                error_callback=raise_error,
            )
            pool.close()
            current_progress = 0
            nr_of_tiles = len(tiles_with_encoded_data)
            self._update_progress(max_progress=nr_of_tiles, msg="Decoding {} tiles...".format(nr_of_tiles))
            while not rs.ready() and not self.cancel_requested:
                time.sleep(0.02)
                QApplication.processEvents()
                remaining = rs._number_left
                index = nr_of_tiles - remaining
                progress = int(100.0 / nr_of_tiles * (index + 1)) if remaining else 100
                if progress != current_progress:
                    current_progress = progress
                    self._update_progress(progress=progress)
            if self.cancel_requested:
                pool.terminate()
            pool.join()

        tiles_by_id = {}
        for t, decoded_data in tile_data_tuples:
            if not decoded_data:
                continue

            tile = tiles_by_id.setdefault(t.id(), t)
            tile.decoded_data = {**tile.decoded_data, **decoded_data}
        tiles = list(tiles_by_id.values())

        info("Decoding finished, {} tiles with data", len(tiles))
        return tiles
def _decode_tiles ( self , tiles_with_encoded_data ) : clip_tiles = not self . _loading_options [ "inspection_mode" ] if self . native_decoding_supported : decoder_func = decode_tile_native else : decoder_func = decode_tile_python tiles_with_encoded_data : List [ Tuple ] = [ ( t [ 0 ] , self . _unzip ( t [ 1 ] ) , clip_tiles ) for t in tiles_with_encoded_data ] tile_data_tuples : List [ Tuple ] = [ ] if len ( tiles_with_encoded_data ) <= self . _nr_tiles_to_process_serial : for t in tiles_with_encoded_data : tile , decoded_data = decoder_func ( t ) if decoded_data : tile_data_tuples . append ( ( tile , decoded_data ) ) else : def raise_error ( e ) : raise e info ( "Processing tiles in parallel..." ) pool = self . _get_pool ( ) rs = pool . map_async ( func = decoder_func , iterable = tiles_with_encoded_data , callback = tile_data_tuples . extend , error_callback = raise_error , ) pool . close ( ) current_progress = 0 nr_of_tiles = len ( tiles_with_encoded_data ) self . _update_progress ( max_progress = nr_of_tiles , msg = "Decoding {} tiles..." . format ( nr_of_tiles ) ) while not rs . ready ( ) and not self . cancel_requested : time . sleep ( 0.02 ) QApplication . processEvents ( ) remaining = rs . _number_left index = nr_of_tiles - remaining progress = int ( 100.0 / nr_of_tiles * ( index + 1 ) ) if remaining else 100 if progress != current_progress : current_progress = progress self . _update_progress ( progress = progress ) if self . cancel_requested : pool . terminate ( ) pool . join ( ) tiles_by_id = { } for t , decoded_data in tile_data_tuples : if not decoded_data : continue tile = tiles_by_id . setdefault ( t . id ( ) , t ) tile . decoded_data = { * * tile . decoded_data , * * decoded_data } tiles = list ( tiles_by_id . values ( ) ) info ( "Decoding finished, {} tiles with data" , len ( tiles ) ) return tiles