Skip to content
Permalink
Browse files

Throw an error if a tileset defines blob format and metatiling.

  • Loading branch information...
sdlime committed Apr 13, 2017
1 parent cfe4bcb commit be1c2ebdd6c563559a3a6f1f33174b419999784f
Showing with 7 additions and 5 deletions.
  1. +1 −4 lib/configuration_xml.c
  2. +6 −1 lib/tileset.c
@@ -593,6 +593,7 @@ void parseTileset(mapcache_context *ctx, ezxml_t node, mapcache_cfg *config)
ezxml_t cur_node;
char* value;
int havewgs84bbox=0;

if(config->mode == MAPCACHE_MODE_NORMAL) {
name = (char*)ezxml_attr(node,"name");
} else {
@@ -706,7 +707,6 @@ void parseTileset(mapcache_context *ctx, ezxml_t node, mapcache_cfg *config)
APR_ARRAY_PUSH(gridlink->intermediate_grids,mapcache_grid_link*) = intermediate_gridlink;
}


mapcache_grid_compute_limits(grid,extent,gridlink->grid_limits,tolerance);

sTolerance = (char*)ezxml_attr(cur_node,"minzoom");
@@ -773,8 +773,6 @@ void parseTileset(mapcache_context *ctx, ezxml_t node, mapcache_cfg *config)
}
}



/* compute wgs84 bbox if it wasn't supplied already */
if(!havewgs84bbox && !strcasecmp(grid->srs,"EPSG:4326")) {
tileset->wgs84bbox = *extent;
@@ -858,7 +856,6 @@ void parseTileset(mapcache_context *ctx, ezxml_t node, mapcache_cfg *config)
tileset->metasize_y = values[1];
}


if ((cur_node = ezxml_child(node,"watermark")) != NULL) {
if(!*cur_node->txt) {
ctx->set_error(ctx,400, "watermark config entry empty");
@@ -72,7 +72,6 @@ char* mapcache_tileset_metatile_resource_key(mapcache_context *ctx, mapcache_met

void mapcache_tileset_configuration_check(mapcache_context *ctx, mapcache_tileset *tileset)
{

/* check we have all we want */
if(tileset->_cache == NULL) {
/* TODO: we should allow tilesets with no caches */
@@ -121,6 +120,12 @@ void mapcache_tileset_configuration_check(mapcache_context *ctx, mapcache_tilese
return;
}
}

if(tileset->format && tileset->format->type == GC_BLOB) {
if(tileset->metasize_x != 1 || tileset->metasize_y != 1) {
ctx->set_error(ctx, 400, "tileset \"%s\" references a BLOB format type, metatiling is not supported for the \"%s\" format", tileset->name, tileset->format->name);
}
}
}

void mapcache_tileset_add_watermark(mapcache_context *ctx, mapcache_tileset *tileset, const char *filename)

0 comments on commit be1c2eb

Please sign in to comment.
You can’t perform that action at this time.