Skip to content

Commit

Permalink
Apply dimension filter to tileindex also if present (#5209)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emanuele Di Giacomo authored and tbonfort committed Feb 24, 2016
1 parent b6fb921 commit 7daec58
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mapwms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 7daec58

Please sign in to comment.