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

mapcache_seed hangs in extract mode if it encounters zoom levels with no tiles #42

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tbonfort
Copy link
Member

We've been using mapcache_seed to create small subsets of large caches using the extract mode. It seems that if it encounters a zoom level in the source cache that doesn't have tiles, it hangs.

Our process is like this:

Seed tileset "test" to level 17 in an mbtiles cache (not sure if cache type matters, probably not):
mapcache_seed -c mapcache.xml -t test -g g -z 0,17 -n 4 -d /mnt/map/data/other/aoi.shp -l aoi

Move test.db to a server that only serves tiles, doesn't create them.

Transfer test to test2 (also mbtiles) for a given bbox. Mapcache.xml used for transferring doesn't have a source mapfile for either "test" or "test2" as we don't want this server to render tiles:
mapcache_seed -c mapcache.xml -t test2 -g g -z 0,16 -n 4 -m transfer -x test -e -8595344.000000,5583572.000000,-8554068.000000,5624848.000000

In the case of our source (i.e. "test" tileset) was generated for a restricted area and the bbox for the transfer includes areas that are not within aoi.shp. Therefore at some zoom level, there were no tiles generated for parts of the bbox.

The error that was returned by mapcache_seed was: mbtiles backend failed on image set: SQL logic error or missing database (1)

@tbonfort
Copy link
Member

@aboudreault, this pull request is a proposed change to avoid hanging the seed process. It does not fix the underlying issue at hand which makes the transfer fail if either the source or destination are missing a <source>. I would suggest using tile->tileset->cache->tile_get() instead of mapcache_tileset_tile_get() as in the first case you can bail out early if the tile is not present in the source tileset.

if a tile is not present in the source tileset, silently skip it instead
of having it rendered by the source.
@tbonfort
Copy link
Member

The previous patch skips absent tiles from the transfer mode completely. I would propose we adopt it as it solves the issues related to tilesets with no defined. If a user wants a tileset with no missing tiles to be transferred, he can always run the same process with mode=seed first.

Base automatically changed from master to main January 15, 2021 22:57
@aboudreault aboudreault removed their assignment Aug 12, 2021
jbo-ads added a commit to jbo-ads/mapcache that referenced this pull request Dec 1, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants