diff --git a/util/mapcache_seed.c b/util/mapcache_seed.c index 0a2b7d63..0cbf8326 100644 --- a/util/mapcache_seed.c +++ b/util/mapcache_seed.c @@ -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"}, @@ -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) { @@ -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);