[GIS] Geoserver SLD: setting fill color from property does not work

geoserversldstyle

I'm trying to style a vector (Point) Layer in Geoserver 2.8 by using a property (attribute field) of the underlying data source.
Here's the snippet:

<PointSymbolizer>
        <Graphic>
          <Mark>
            <WellKnownName>circle</WellKnownName>
            <Fill>
              <CssParameter name="fill">
                <ogc:PropertyName>HEXCOLOR</ogc:PropertyName>
              </CssParameter>
              <CssParameter name="fill-opacity">
                1
              </CssParameter>
            </Fill>
          </Mark>
        </Graphic>
</PointSymbolizer>

Where HEXCOLOR is a string like #fff000.
However, the point is rendered with white filling.

I have so far checked

  • the data (Q-GIS is able to render the color definitions)
  • the syntax

Best Answer

I'm not familiar with that method, however you may use rule based styling for symbolizing various feature classifications:

Styling rules define the portrayal of features. A rule combines a filter with any number of symbolizers. Features for which the filter condition evaluates as true are rendered using the the symbolizers in the rule.