Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small fixes for smaller composite zooms #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions untiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions untiler/scripts/tile_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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]:
Expand Down