Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I tell mapserver to ignore a filter that is set in a mapfile?

I am displaying a wms layer with point features using mapserver. In one of the layers in my mapfile I have defined a filter similar to this:

FILTER          "mycolumn='%myvalue%'"

such that I can use runtime substitution in a mapserver request similar to this one:

This works just fine.

However, sometimes I would like to display the entire dataset and thus forcing mapserver to ignore the filter.

Is it possible to deactivate the filter in a request?

share|improve this question
up vote 3 down vote accepted

A working solution is similar to what @seruva19 suggested. The trick is to add a boolean value to the filter as an alternative to the previous filter:

FILTER    "(mycolumn='%myvalue%') or %allvars%"

where the validation forces the value to be TRUE

  "allvals"    "^TRUE$"

and the default of allvals is set to FALSE

    'default_allvals'   'FALSE'
share|improve this answer

I'm not sure, but this trick may work:

  1. Add FILTER to validation block of the layer's description, like this:

          'FILTER' '.'
  2. When you want to show all of the data in your layer, add the following string to your URL request :


I hope this will help.

share|improve this answer
thanks a lot seruva19, your answer hinted in the right direction, helping me to get to the solution. I did not understand how yours works exactly... – yellowcap Oct 9 '12 at 19:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.