Permalink
Browse files

Apply dimension filter to tileindex also if present (#5209)

  • Loading branch information...
edigiacomo authored and tbonfort committed Dec 11, 2015
1 parent b6fb921 commit 7daec58ba4651779b458253ce82100fe42ce7f88
Showing with 10 additions and 0 deletions.
  1. +10 −0 mapwms.c
View
@@ -685,6 +685,7 @@ int msWMSApplyDimensionLayer(layerObj *lp, const char *item, char *value, int fo
{
int result = MS_FALSE;
char *pszExpression=NULL;
+ int tlpindex = -1;
if (lp && item && value) {
/*for the value, we support descrete values (2005) */
@@ -693,8 +694,17 @@ int msWMSApplyDimensionLayer(layerObj *lp, const char *item, char *value, int fo
pszExpression = FLTGetExpressionForValuesRanges(lp, (char *)item, value, forcecharcter);
if (pszExpression) {
+ // If tileindex is set, the filter is applied to tileindex too.
+ if (lp->tileindex && (tlpindex = msGetLayerIndex(lp->map, lp->tileindex)) != -1) {
+ if(FLTApplyExpressionToLayer((GET_LAYER(lp->map, tlpindex)), pszExpression))
+ result = MS_TRUE;
+ else
+ result = MS_FALSE;
+ }
if(FLTApplyExpressionToLayer(lp, pszExpression))
result = MS_TRUE;
+ else
+ result = MS_FALSE;
msFree(pszExpression);
}
}

0 comments on commit 7daec58

Please sign in to comment.