stylesgeoserversld

Geoserver sld style


I am writing a style using geoserver, Can I organize SLD like a picture below?

style example


Solution

  • The SLD specification allows you to use a Graphic to fill a polygon, GeoServer extends the specification to allow the use of a dynamic expression to give the location of the graphic.

    This blog post gives an example of using a PointSymboliser with dynamic graphics. It uses an epsression in the external graphic to generate the image name:

    <ExternalGraphic>
       <OnlineResource xlink:type="simple" 
        xlink:href="http://www.usautoparts.net/bmw/images/states/tn_${STATE_ABBR}.jpg"/>
       <Format>image/gif</Format>
    </ExternalGraphic>