[mapserver-users] Run-time Substitution vs. Variable Substitutionand what are the Parameters Supported?

Steve Lime Steve.Lime at dnr.state.mn.us
Mon Sep 15 18:11:40 EDT 2008


Variable substitution refers to those parameters that can have part of their value changed remotely. The supported
parameters are:

  LAYER: data, tileindex, connection and filter
  CLASS: expression

Setting up parameter validation is STRONGLY encouraged. In your layer metadata you'd define keys based on variable
names to do validation. For example, if your variable was called 'foo' and you wanted to allow a single digit integer from
1 to 9 as a value you'd do:

  METADATA
    ...
    'foo_validation_pattern'      '^[1-9]$'
    ...
  END

The value of 'foo' would have to pass the supplied regex before the parameter would be altered. It is up to you to author
the correct validation pattern.

MapServer also supports some URL-based configuration. This is different than substitution in that you are completely
changing values of object parameters or even creating new objects. That is, you can change a class color or create
a new point feature. Support here (at the moment) is limited to parameters that are validated as part of mapfile parsing.
For example, MapServer checks to make sure a color is of the correct format, that a double is a double and so on. The
only two exceptions are layer DATA and TEMPLATE properties and they are required to validate against DATAPATTERN or 
TEMPLATEPATTERN before being used. 

This is all going to be generalized and improved in 5.4.

Steve


>>> On 9/9/2008 at 2:42 PM, in message
<fa2ac0580809091242h618c45aexbeba8041a5c491b9 at mail.gmail.com>, "John Mitchell"
<mitchelljj98 at gmail.com> wrote:
> Hi,
> 
> What is the difference between Run-time Substitution vs. Variable
> Substitution within a map file?
> They look like they are the same thing.
> 
> Also what are the Parameters Supported?
> 
>>From documentation that is almost 3 years old it lists the following
> parametes (listed below) is this list complete?
> 
> 
>    - LAYER: DATA (must validate against DATAPATTERN)
>    - LAYER: TILEINDEX
>    - LAYER: CONNECTION
>    - LAYER: FILTER
>    - CLASS EXPRESSION
> 
> 
> Thanks,



More information about the mapserver-users mailing list