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
Open
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
15 changes: 9 additions & 6 deletions util/mapcache_seed.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static const apr_getopt_option_t seed_options[] = {
{ "mode", 'm', TRUE, "mode: seed (default), delete or transfer" },
{ "older", 'o', TRUE, "reseed tiles older than supplied date (format: year/month/day hour:minute, eg: 2011/01/31 20:45" },
{ "dimension", 'D', TRUE, "set the value of a dimension (format DIMENSIONNAME=VALUE). Can be used multiple times for multiple dimensions" },
{ "transfer", 'x', TRUE, "tileset to transfer" },
{ "transfer", 'x', TRUE, "tileset where tiles should be transfered to" },
#ifdef USE_CLIPPERS
{ "ogr-datasource", 'd', TRUE, "ogr datasource to get features from"},
{ "ogr-layer", 'l', TRUE, "layer inside datasource"},
Expand Down Expand Up @@ -406,7 +406,7 @@ cmd examine_tile(mapcache_context *ctx, mapcache_tile *tile)
}
} else {
// the tile does not exist
if(mode == MAPCACHE_CMD_SEED || mode == MAPCACHE_CMD_TRANSFER) {
if(mode == MAPCACHE_CMD_SEED) {
#ifdef USE_CLIPPERS
/* check we are in the requested features before deleting the tile */
if(nClippers > 0) {
Expand Down Expand Up @@ -629,13 +629,16 @@ void seed_worker()
mapcache_unlock_resource(&seed_ctx, mapcache_tileset_metatile_resource_key(&seed_ctx,mt));
}
} else if (cmd.command == MAPCACHE_CMD_TRANSFER) {
int i;
int i,get_ret;
mapcache_metatile *mt = mapcache_tileset_metatile_get(&seed_ctx, tile);
for (i = 0; i < mt->ntiles; i++) {
mapcache_tile *subtile = &mt->tiles[i];
mapcache_tileset_tile_get(&seed_ctx, subtile);
subtile->tileset = tileset_transfer;
tileset_transfer->cache->tile_set(&seed_ctx, subtile);
get_ret = subtile->tileset->cache->tile_get(&seed_ctx,subtile);
if(GC_HAS_ERROR(&seed_ctx)) break;
if(get_ret == MAPCACHE_SUCCESS) {
subtile->tileset = tileset_transfer;
tileset_transfer->cache->tile_set(&seed_ctx, subtile);
}
}
} else { //CMD_DELETE
mapcache_tileset_tile_delete(&seed_ctx,tile,MAPCACHE_TRUE);
Expand Down