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

fix mercator baselevel(overviews generation) #560

Open
Scartography opened this issue Jul 14, 2023 · 2 comments
Open

fix mercator baselevel(overviews generation) #560

Scartography opened this issue Jul 14, 2023 · 2 comments

Comments

@Scartography
Copy link
Collaborator

on_edge_use 'rt' results in an invalid tile: row (128) exceeds matrix height (128)
File "/usr/local/src/mapchete_hub/mapchete_hub/app.py", line 561, in job_wrapper
_run_job_on_cluster(
File "/usr/local/src/mapchete_hub/mapchete_hub/app.py", line 695, in _run_job_on_cluster
for i, _ in enumerate(job, 1):
File "/usr/local/lib/python3.8/site-packages/mapchete/_processing.py", line 141, in iter
yield from self._run()
File "/usr/local/lib/python3.8/site-packages/mapchete/_processing.py", line 107, in _run
yield from self.func(*self.fargs, executor=self.executor, **self.fkwargs)
File "/usr/local/lib/python3.8/site-packages/mapchete/commands/_execute.py", line 213, in _process_everything
for future in mp.compute(**kwargs):
File "/usr/local/lib/python3.8/site-packages/mapchete/_core.py", line 235, in compute
yield from compute(self, **kwargs)
File "/usr/local/lib/python3.8/site-packages/mapchete/_processing.py", line 296, in compute
for num_processed, future in enumerate(
File "/usr/local/lib/python3.8/site-packages/mapchete/_processing.py", line 677, in _compute_tasks
for future in _process_batches(
File "/usr/local/lib/python3.8/site-packages/mapchete/_processing.py", line 711, in _run_multi_overviews
for future in executor.as_completed(
File "/usr/local/lib/python3.8/site-packages/mapchete/_executor.py", line 318, in as_completed
for item in iterable:
File "/usr/local/lib/python3.8/site-packages/mapchete/_processing.py", line 713, in
iterable=(
File "/usr/local/lib/python3.8/site-packages/mapchete/_processing.py", line 483, in _filter_skipable
for tile, skip in process.skip_tiles(tiles_batches=tiles_batches):
File "/usr/local/lib/python3.8/site-packages/mapchete/_core.py", line 210, in skip_tiles
yield from tiles_exist(
File "/usr/local/lib/python3.8/site-packages/mapchete/path.py", line 660, in tiles_exist
yield from _process_tiles_batches_exist(
File "/usr/local/lib/python3.8/site-packages/mapchete/path.py", line 709, in _process_tiles_batches_exist
for batch in executor.as_completed(
File "/usr/local/lib/python3.8/site-packages/mapchete/_executor.py", line 89, in as_completed
for i, item in enumerate(iterable, 1):
File "/usr/local/lib/python3.8/site-packages/mapchete/path.py", line 711, in
(list(b) for b in process_tiles_batches),
File "/usr/local/lib/python3.8/site-packages/mapchete/_core.py", line 178, in get_process_tiles
for tile in self.config.process_pyramid.tiles_from_geom(
File "/usr/local/lib/python3.8/site-packages/mapchete/tile.py", line 135, in tiles_from_geom
for batch in self.tile_pyramid.tiles_from_geom(
File "/usr/local/lib/python3.8/site-packages/tilematrix/_tilepyramid.py", line 242, in tiles_from_geom
for batch in self.tiles_from_bbox(
File "/usr/local/lib/python3.8/site-packages/tilematrix/_tilepyramid.py", line 210, in tiles_from_bbox
yield from self.tiles_from_bounds(geometry.bounds, zoom, batch_by=batch_by)
File "/usr/local/lib/python3.8/site-packages/tilematrix/_tilepyramid.py", line 198, in tiles_from_bounds
yield from _global_tiles_from_bounds(self, bounds, zoom, batch_by=batch_by)
File "/usr/local/lib/python3.8/site-packages/tilematrix/_funcs.py", line 213, in _global_tiles_from_bounds
yield from _tiles_from_cleaned_bounds(tp, bounds, zoom, batch_by=batch_by)
File "/usr/local/lib/python3.8/site-packages/tilematrix/_funcs.py", line 219, in _tiles_from_cleaned_bounds
lb = _tile_from_xy(tp, bounds.left, bounds.bottom, zoom, on_edge_use="rt")
File "/usr/local/lib/python3.8/site-packages/tilematrix/_funcs.py", line 261, in _tile_from_xy
raise ValueError(

@Scartography
Copy link
Collaborator Author

This is an issue within tilematrix package (tmx -g mercator -f GeoJSON tiles -- 3 -20037508.34 -20048966.1 20037508.34 20048966.1):

Traceback (most recent call last):
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/tilematrix/_funcs.py", line 259, in _tile_from_xy
return tp.tile(zoom, row, col)
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/tilematrix/_tilepyramid.py", line 75, in tile
return Tile(self, zoom, row, col)
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/tilematrix/_tile.py", line 31, in init
self.is_valid()
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/tilematrix/_tile.py", line 176, in is_valid
raise ValueError("row (%s) exceeds matrix height (%s)" % (self.row, rows))
ValueError: row (8) exceeds matrix height (8)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/suprd/miniconda3/envs/s2/bin/tmx", line 10, in
sys.exit(tmx())
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/tilematrix/tmx/main.py", line 142, in tiles
tile = next(tiles)
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/tilematrix/_tilepyramid.py", line 198, in tiles_from_bounds
yield from _global_tiles_from_bounds(self, bounds, zoom, batch_by=batch_by)
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/tilematrix/_funcs.py", line 213, in _global_tiles_from_bounds
yield from _tiles_from_cleaned_bounds(tp, bounds, zoom, batch_by=batch_by)
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/tilematrix/_funcs.py", line 219, in _tiles_from_cleaned_bounds
lb = _tile_from_xy(tp, bounds.left, bounds.bottom, zoom, on_edge_use="rt")
File "/home/suprd/miniconda3/envs/s2/lib/python3.8/site-packages/tilematrix/_funcs.py", line 261, in _tile_from_xy
raise ValueError(
ValueError: on_edge_use 'rt' results in an invalid tile: row (8) exceeds matrix height (8)

@Scartography
Copy link
Collaborator Author

Aha I got wrong bounds...but still it should clip and choose the tiles accordingly:

  • -20037508.34 -20048966.1 20037508.34 20048966.1
  • -20037508.3427892 -20037508.3427892 20037508.3427892 20037508.3427892

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant