[Geoserver-users] calculation in SLD

Hi,

To calculate the width of a line depending on the scale, I want to make a
calculation in the stroke-width Tag which should multiply the width in the
attribute WIDTHAVERAGE with a given factor, in the kind shown below (which
does not work):

<sld:CssParameter name="stroke-width">
    <ogc:PropertyName>WIDTHAVERAGE</ogc:PropertyName> * 3
</sld:CssParameter>

Is this possible somehow?

THX
--
View this message in context: http://old.nabble.com/calculation-in-SLD-tp27238676p27238676.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Rautec ha scritto:

Hi,

To calculate the width of a line depending on the scale, I want to make a
calculation in the stroke-width Tag which should multiply the width in the
attribute WIDTHAVERAGE with a given factor, in the kind shown below (which
does not work):

<sld:CssParameter name="stroke-width">
    <ogc:PropertyName>WIDTHAVERAGE</ogc:PropertyName> * 3
</sld:CssParameter>

Is this possible somehow?

It should be something like:

<ogc:Mul>
   <ogc:PropertyName>WIDTHAVERAGE</ogc:PropertyName>
   <ogc:Literal>3</ogc:Literal>
</ogc:Mul>

If this does not work I probably used the wrong tag in Mul,
have a look at the Filter Encoding Specification 1.0 for
details on how to setup the expression

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.