[mapserver-commits] r12287 - in trunk/mapserver/mapcache: include
src
svn at osgeo.org
svn at osgeo.org
Fri Aug 26 07:14:01 EDT 2011
Author: tbonfort
Date: 2011-08-26 04:14:01 -0700 (Fri, 26 Aug 2011)
New Revision: 12287
Modified:
trunk/mapserver/mapcache/include/geocache.h
trunk/mapserver/mapcache/src/geocache_seed.c
trunk/mapserver/mapcache/src/service_tms.c
trunk/mapserver/mapcache/src/service_wms.c
trunk/mapserver/mapcache/src/service_wmts.c
trunk/mapserver/mapcache/src/tileset.c
Log:
use shorter matrixset ids for wmts
thomas.bonfort | 2011-01-31 12:22:35 +0100 (Mon, 31 Jan 2011)
Modified: trunk/mapserver/mapcache/include/geocache.h
===================================================================
--- trunk/mapserver/mapcache/include/geocache.h 2011-08-26 11:13:55 UTC (rev 12286)
+++ trunk/mapserver/mapcache/include/geocache.h 2011-08-26 11:14:01 UTC (rev 12287)
@@ -845,7 +845,7 @@
* @param pool
* @return
*/
-geocache_tile* geocache_tileset_tile_create(apr_pool_t *pool, geocache_tileset *tileset);
+geocache_tile* geocache_tileset_tile_create(apr_pool_t *pool, geocache_tileset *tileset, geocache_grid_link *grid_link);
/**
* \brief create and initalize a tileset
Modified: trunk/mapserver/mapcache/src/geocache_seed.c
===================================================================
--- trunk/mapserver/mapcache/src/geocache_seed.c 2011-08-26 11:13:55 UTC (rev 12286)
+++ trunk/mapserver/mapcache/src/geocache_seed.c 2011-08-26 11:14:01 UTC (rev 12287)
@@ -84,13 +84,11 @@
int x, int y, int z,
geocache_grid_link *grid_link,
geocache_context *tmpctx) {
- geocache_tile tile;
- tile.x = x;
- tile.y = y;
- tile.z = z;
- tile.tileset = tileset;
- tile.grid_link = grid_link;
- return tileset->cache->tile_exists(tmpctx,&tile);
+ geocache_tile *tile = geocache_tileset_tile_create(tmpctx->pool,tileset,grid_link);
+ tile->x = x;
+ tile->y = y;
+ tile->z = z;
+ return tileset->cache->tile_exists(tmpctx,tile);
}
int geocache_context_seeding_get_next_tile(geocache_context_seeding *ctx, geocache_tile *tile, geocache_context *tmpcontext) {
@@ -167,8 +165,7 @@
static void* APR_THREAD_FUNC doseed(apr_thread_t *thread, void *data) {
geocache_context_seeding *ctx = (geocache_context_seeding*)data;
geocache_context *gctx = (geocache_context*)ctx;
- geocache_tile *tile = geocache_tileset_tile_create(gctx->pool, ctx->tileset);
- tile->grid_link = ctx->grid_link;
+ geocache_tile *tile = geocache_tileset_tile_create(gctx->pool, ctx->tileset, ctx->grid_link);
geocache_context tile_ctx;
geocache_context_init(&tile_ctx);
tile_ctx.global_lock_aquire = dummy_lock_aquire;
Modified: trunk/mapserver/mapcache/src/service_tms.c
===================================================================
--- trunk/mapserver/mapcache/src/service_tms.c 2011-08-26 11:13:55 UTC (rev 12286)
+++ trunk/mapserver/mapcache/src/service_tms.c 2011-08-26 11:14:01 UTC (rev 12287)
@@ -232,7 +232,7 @@
req->request.type = GEOCACHE_REQUEST_GET_TILE;
req->ntiles = 1;
req->tiles = (geocache_tile**)apr_pcalloc(ctx->pool,sizeof(geocache_tile*));
- req->tiles[0] = geocache_tileset_tile_create(ctx->pool, tileset);
+ req->tiles[0] = geocache_tileset_tile_create(ctx->pool, tileset, grid_link);
req->tiles[0]->x = x;
if(((geocache_service_tms*)this)->reverse_y) {
req->tiles[0]->y = grid_link->grid->levels[z]->maxy - y - 1;
@@ -240,7 +240,6 @@
req->tiles[0]->y = y;
}
req->tiles[0]->z = z;
- req->tiles[0]->grid_link = grid_link;
geocache_tileset_tile_validate(ctx,req->tiles[0]);
GC_CHECK_ERROR(ctx);
*request = (geocache_request*)req;
Modified: trunk/mapserver/mapcache/src/service_wms.c
===================================================================
--- trunk/mapserver/mapcache/src/service_wms.c 2011-08-26 11:13:55 UTC (rev 12286)
+++ trunk/mapserver/mapcache/src/service_wms.c 2011-08-26 11:14:01 UTC (rev 12287)
@@ -324,12 +324,11 @@
return;
}
- tile = geocache_tileset_tile_create(ctx->pool, tileset);
+ tile = geocache_tileset_tile_create(ctx->pool, tileset, grid_link);
if(!tile) {
ctx->set_error(ctx, 500, "failed to allocate tile");
return;
}
- tile->grid_link = grid_link;
geocache_tileset_tile_lookup(ctx, tile, bbox);
GC_CHECK_ERROR(ctx);
geocache_tileset_tile_validate(ctx,tile);
Modified: trunk/mapserver/mapcache/src/service_wmts.c
===================================================================
--- trunk/mapserver/mapcache/src/service_wmts.c 2011-08-26 11:13:55 UTC (rev 12286)
+++ trunk/mapserver/mapcache/src/service_wmts.c 2011-08-26 11:14:01 UTC (rev 12287)
@@ -522,7 +522,7 @@
req->tiles = (geocache_tile**)apr_pcalloc(ctx->pool,sizeof(geocache_tile*));
- req->tiles[0] = geocache_tileset_tile_create(ctx->pool, tileset);
+ req->tiles[0] = geocache_tileset_tile_create(ctx->pool, tileset, grid_link);
if(!req->tiles[0]) {
ctx->set_error(ctx, 500, "failed to allocate tile");
return;
@@ -538,7 +538,6 @@
apr_table_set(req->tiles[0]->dimensions,dimension->name,value);
}
}
- req->tiles[0]->grid_link = grid_link;
req->tiles[0]->x = col;
req->tiles[0]->y = grid_link->grid->levels[level]->maxy - row - 1;
Modified: trunk/mapserver/mapcache/src/tileset.c
===================================================================
--- trunk/mapserver/mapcache/src/tileset.c 2011-08-26 11:13:55 UTC (rev 12286)
+++ trunk/mapserver/mapcache/src/tileset.c 2011-08-26 11:14:01 UTC (rev 12287)
@@ -160,10 +160,19 @@
/*
* allocate and initialize a tile for a given tileset
*/
-geocache_tile* geocache_tileset_tile_create(apr_pool_t *pool, geocache_tileset *tileset) {
+geocache_tile* geocache_tileset_tile_create(apr_pool_t *pool, geocache_tileset *tileset, geocache_grid_link *grid_link) {
geocache_tile *tile = (geocache_tile*)apr_pcalloc(pool, sizeof(geocache_tile));
tile->tileset = tileset;
tile->expires = tileset->expires;
+ tile->grid_link = grid_link;
+ if(tileset->dimensions) {
+ int i;
+ tile->dimensions = apr_table_make(pool,tileset->dimensions->nelts);
+ for(i=0;i<tileset->dimensions->nelts;i++) {
+ geocache_dimension *dimension = APR_ARRAY_IDX(tileset->dimensions,i,geocache_dimension*);
+ apr_table_set(tile->dimensions,dimension->name,dimension->default_value);
+ }
+ }
return tile;
}
More information about the mapserver-commits
mailing list