Skip to content

Commit d330feb

Browse files
committed
be more lenient with "DIM_" prefix for WMS dimensions
1 parent de5cdad commit d330feb

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/service_wms.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,14 @@ void _mapcache_service_wms_parse_request(mapcache_context *ctx, mapcache_service
667667
} else {
668668
dim_name = apr_pstrcat(ctx->pool, "dim_", dimension->name, NULL);
669669
}
670-
if((value = (char*)apr_table_get(params,dim_name)) != NULL) {
670+
if((value = (char*)apr_table_get(params,dim_name)) == NULL) {
671+
if(strcasecmp(dimension->name,"TIME") && strcasecmp(dimension->name,"ELEVATION")) {
672+
/* also test for the dimension without the DIM_ prefix if the latter was not found in hte KVP params */
673+
value = (char*)apr_table_get(params,dimension->name);
674+
}
675+
}
676+
677+
if(value) {
671678
char *tmpval = apr_pstrdup(ctx->pool,value);
672679
int ok;
673680
if(dimension->skip_validation) {

lib/source_wms.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ void _mapcache_source_wms_render_map(mapcache_context *ctx, mapcache_map *map)
5555
int i;
5656
for(i=0; i<elts->nelts; i++) {
5757
apr_table_entry_t entry = APR_ARRAY_IDX(elts,i,apr_table_entry_t);
58+
/* set both DIM_key=val and key=val KVP params */
5859
apr_table_setn(params,entry.key,entry.val);
60+
if(strcasecmp(entry.key,"TIME") && strcasecmp(entry.key,"ELEVATION")) {
61+
char *dim_name = apr_pstrcat(ctx->pool,"DIM_",entry.key,NULL);
62+
apr_table_setn(params,dim_name,entry.val);
63+
}
5964
}
6065

6166
}

0 commit comments

Comments
 (0)