4

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
  • 1
    Try with fill-opacity = 1.0 – WKT Jun 6 '16 at 15:22
  • I'd suggest to ask on geoserver-users, sharing a link to a data sample and full style. – Andrea Aime Jun 7 '16 at 6:05
  • Do you really need the <ogc:PropertyName>...? For a polygonSymbolizer the following works for me: <sld:CssParameter name="fill">#FFCCB3</sld:CssParameter> – nmtoken Dec 24 '16 at 11:05
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.