I want to use present year in a CLASS in a map file. I managed to write permanent expressions like:
LAYER
CLASSITEM "YEAR"
...
CLASS
NAME "Previous years"
EXPRESSION ('[YEAR]'<'2015')
But I failed to construct a working expression, which includes a reference to present time.
There is an example of what I would like to write:
LAYER
CLASSITEM "YEAR"
...
CLASS
NAME "Present year" # Year n
EXPRESSION ('[YEAR]'=='([date format=YYYY]'))
...
CLASS
NAME "Previous year" # Year n-1
EXPRESSION ('[YEAR]'=='([date format=YYYY]'-'1'))
...
CLASS
NAME "Archived years" # Years <n-1
EXPRESSION ('[YEAR]'<'([date format=YYYY]'-'1'))
I adapted [date format=YYYY] expression from a MapServer template page.It didn't work.... But unfortunately I did find no simple examples of templates imported variables direct use in a map file, especially for [date] variables.
Has someone any idea of what it could look like? I'm just looking for reusable examples that I could adapt for my scripts.
[data format="%Y"]
. I would also read some reference to strftime() for example linux.die.net/man/3/strftimeCLASSITEM [attribute] Item name in attribute table to use for class lookups.