Using simple Math in SLD file on Geoserver?

You can use the math functions ogc:Mul ogc:Div ogc:Add & ogc:Sub to do simple maths on properties.

So your example would become:

<sld:CssParameter name="font-size">
    <ogc:Mul>
       <ogc:PropertyName>text_size</ogc:PropertyName>
       <ogc:Literal>2.5</ogc:Literal>
    </ogc:Mul>
</sld:CssParameter>

The only issue is that technically the SLD specification may not allow you to use a function in a CssParameter. However GeoServer is much more forgiving and will allow it.

If you ever need more complex functions see the reference page.

Tags:

Geoserver

Sld