[mapserver-users] Mapserver Template - Conditionals

Donald Kerr donald.kerr at dkerr.co.uk
Wed Jul 25 12:25:02 PDT 2012


Hi List,

A few questions/points on templating:

1.
I know it's possible to use "item" in a template as follows:

[item name="featurecode" pattern="10021"
format="<osgb:theme>Buildings</osgb:theme><osgb:descriptiveGroup>Building</o
sgb:descriptiveGroup>" escape=none]

But, is it possible to do something like:

[item featurecode="10021" pattern="1" AND item lineitem="12345" pattern="2"
format="....."]

That is, returns true of both, or more, criteria are met.

The only other way I can think of doing this is in the SQL query that runs
on the layer.


2.
Also, when I use use [item ...] and the criteria isn't met, it still causes
an additional blank line to be created in the output file. It would be quite
good if it did not create the cr/lf. Maybe nullformat could be used to
enforce this in some way but nullformat="" still creates a blank line.


3.
It would be nice if the item tag could also deal with a case/select
statement e.g.

[item name="A" pattern="1" format="Output1"]
ELSE
[item name="B" pattern="2" format="Output2"]
ELSE
[item name="C" pattern="3" format="Output3"]
DEFAULT
[item name="D" pattern="4" format="Output4"]


4.
And finally, when using:

[resultset layer=LayerName]
[feature]

Two blank lines are created in the output file. It would be good if these
tags didn't do that.


Many thanks.

Regards,

Donald




More information about the MapServer-users mailing list