diff --git a/untiler/__init__.py b/untiler/__init__.py index 45813ed..39d2bef 100644 --- a/untiler/__init__.py +++ b/untiler/__init__.py @@ -148,7 +148,6 @@ def streaming_tile_worker(data): toFaux, frFaux = affaux(fDiff) if not globalArgs['no_fill']: - print('filling') ## Read and write the fill tiles first for t in subtiler.get_fill_super_tiles(superTiles, data['maxCovTiles'], fThresh): z, x, y = t @@ -219,7 +218,7 @@ def stream_dir(inputDir, outputDir, compositezoom, maxzoom, logdir, read_templat raise ValueError("No tiles were found for that template") if maxzoom: - allTiles = tiler.filter_tiles(allTiles, maxzoom) + allTiles = tiler.filter_tiles(allTiles, maxzoom, compositezoom) if allTiles.shape[0] == 0: raise ValueError("No tiles were found below that maxzoom") @@ -237,7 +236,7 @@ def stream_dir(inputDir, outputDir, compositezoom, maxzoom, logdir, read_templat 'logdir': logdir, 'creation_opts': creation_opts, 'no_fill': no_fill - })) + })) superTiles = tiler.get_super_tiles(allTiles, compositezoom) diff --git a/untiler/scripts/tile_utils.py b/untiler/scripts/tile_utils.py index 9a599a4..77cd04b 100644 --- a/untiler/scripts/tile_utils.py +++ b/untiler/scripts/tile_utils.py @@ -117,8 +117,8 @@ def get_sub_tiles(self, subTiles, superTiles): 'z': z }) - def filter_tiles(self, tiles, zoomfloor): - return tiles[np.where(tiles[:, 0] <= zoomfloor)] + def filter_tiles(self, tiles, zoomfloor, zoomceil): + return tiles[np.where((tiles[:, 0] <= zoomfloor) & (tiles[:, 0] >= zoomceil))] def get_fill_super_tiles(self, superTiles, fillTiles, fillThresh): for ct in ((np.all(superTiles == a, axis=1).sum(), a) for a in fillTiles): @@ -141,7 +141,7 @@ def parse_template(template): if pattern.match(template): valPattern = re.compile(r"{(z|x|y)}") filepath = re.compile(r"(jpg|png|tif)$") - sepmatch = re.compile(r"(?:{z})(/|-)(?:{x})(/|-)(?:{y})") + sepmatch = re.compile(r"(?:{z})(/|-|_)(?:{x})(/|-|_)(?:{y})") separator = sepmatch.findall(template)[0] if len(separator) != 2 or separator[0] != separator[1]: