[mapserver-commits] r12619 - trunk/mapserver/mapcache/src
svn at osgeo.org
svn at osgeo.org
Wed Oct 5 08:55:28 EDT 2011
Author: tbonfort
Date: 2011-10-05 05:55:28 -0700 (Wed, 05 Oct 2011)
New Revision: 12619
Modified:
trunk/mapserver/mapcache/src/mapcache_seed.c
Log:
fix problem with recursive seeder not seeding all tiles if not starting from level 0
add verbose flag to see debug messages
Modified: trunk/mapserver/mapcache/src/mapcache_seed.c
===================================================================
--- trunk/mapserver/mapcache/src/mapcache_seed.c 2011-10-04 15:02:28 UTC (rev 12618)
+++ trunk/mapserver/mapcache/src/mapcache_seed.c 2011-10-05 12:55:28 UTC (rev 12619)
@@ -58,6 +58,7 @@
mapcache_grid_link *grid_link;
int nthreads=1;
int quiet = 0;
+int verbose = 0;
int sig_int_received = 0;
int error_detected = 0;
apr_queue_t *work_queue;
@@ -103,6 +104,7 @@
#endif
{ "help", 'h', FALSE, "show help" },
{ "quiet", 'q', FALSE, "don't show progress info" },
+ { "verbose", 'v', FALSE, "show debug log messages" },
{ NULL, 0, 0, NULL },
};
@@ -118,7 +120,15 @@
void dummy_lock_aquire(mapcache_context *ctx){}
void dummy_lock_release(mapcache_context *ctx){}
-void dummy_log(mapcache_context *ctx, mapcache_log_level level, char *msg, ...){}
+void dummy_log(mapcache_context *ctx, mapcache_log_level level, char *msg, ...){
+ if(verbose) {
+ va_list args;
+ va_start(args,msg);
+ vfprintf(stderr,msg,args);
+ va_end(args);
+ }
+ printf("\n");
+}
void mapcache_context_seeding_log(mapcache_context *ctx, mapcache_log_level level, char *msg, ...) {
@@ -336,10 +346,23 @@
apr_pool_create(&cmd_ctx.pool,ctx.pool);
mapcache_tile *tile = mapcache_tileset_tile_create(ctx.pool, tileset, grid_link);
tile->dimensions = dimensions;
- tile->x = x;
- tile->y = y;
- tile->z = z;
- cmd_recurse(&cmd_ctx,tile);
+ do {
+ tile->x = x;
+ tile->y = y;
+ tile->z = z;
+ cmd_recurse(&cmd_ctx,tile);
+ x += tileset->metasize_x;
+ if( x >= grid_link->grid_limits[z][2] ) {
+ y += tileset->metasize_y;
+ if( y < grid_link->grid_limits[z][3]) {
+ x = grid_link->grid_limits[z][0];
+ }
+ }
+ } while (
+ x < grid_link->grid_limits[z][2]
+ &&
+ y < grid_link->grid_limits[z][3]
+ );
//instruct rendering threads to stop working
int n;
for(n=0;n<nthreads;n++) {
@@ -459,6 +482,7 @@
ctx.log= mapcache_context_seeding_log;
ctx.global_lock_aquire = dummy_lock_aquire;
ctx.global_lock_release = dummy_lock_release;
+ //ctx.has_threads = 1;
apr_getopt_init(&opt, ctx.pool, argc, argv);
seededtiles=seededtilestot=queuedtilestot=0;
@@ -477,6 +501,9 @@
case 'q':
quiet = 1;
break;
+ case 'v':
+ verbose = 1;
+ break;
case 'c':
configfile = optarg;
break;
More information about the mapserver-commits
mailing list