def _to_tiles(self, images, tminx, tminy, tmaxx, tmaxy):
        tiles = []
        row = 0
        url_number = 0
        for ty in range(tminy, tmaxy+1):
            tiles.append([])
            for tx in range(tminx, tmaxx+1):
                image = images[url_number]
                bbox = self._generate_bbox(tx, ty, Constants.ZOOM)
                tile = Tile.from_tile(image, bbox)
                tiles[row].append(tile)
                url_number += 1
            row += 1

        return tiles
 def load_tile(self):
     tiles = self._download_tiles(self.bbox)
     image = TileLoader._tilematrix_to_image(tiles)
     bbox = TileLoader._get_bbox_by_tiles(tiles)
     return Tile.from_tile(image, bbox)
 def test_instantiate_from_tile(self):
     tile = Tile.from_tile(None, self.Rappi())
     self.assertTrue(tile.bbox.bottom == self.Rappi().bottom)