Is there any way to use the conditional statement in SLD? somehow using if_then_else
like this Pseudocode:
if (10 =< variable =< 100) {
then Multiply variable by 2
} else {
then Multiply it by 4
}
Or if it is also possible to have a multiple if_then_else
if (10 =< variable =< 100) {
then Multiply variable by 2
} if (100 < variable =< 200) {
then Multiply it by 3
} else {
then Multiply it by 4
}
Example.sld
<ogc:Filter>
<ogc:Function name="if_then_else">
<ogc:PropertyName>variable</ogc:PropertyName>
<!-- check if the "variable" is between 10 and 1000 -->
<ogc:PropertyIsBetween>
<ogc:LowerBoundary>
<ogc:Literal>10</ogc:Literal>
</ogc:LowerBoundary>
<ogc:UpperBoundary>
<ogc:Literal>100</ogc:Literal>
</ogc:UpperBoundary>
</ogc:PropertyIsBetween>
<!-- if it is between this range then multiply it by 2 -->
<ogc:Mul>
<ogc:PropertyName>variable</ogc:PropertyName>
<ogc:Literal>2</ogc:Literal>
</ogc:Mul>
<!-- else multiply it by 4 -->
<ogc:Mul>
<ogc:PropertyName>variable</ogc:PropertyName>
<ogc:Literal>4</ogc:Literal>
</ogc:Mul>
</ogc:Function>
</ogc:Filter>