[GIS] Color and Graphic fill in SLD geoserver

geoserversld

Is it possible to add two overlays in <Fill> tag.

For example, I want to add this color, #1e9e1e, and a graphic fill. xlink:href="vegetation.png".

This is my code:


<Fill>
<CssParameter name="fill">#1e9e1e</CssParameter>
<GraphicFill>
<Graphic>
<ExternalGraphic>
<OnlineResource xlink:type="simple" xlink:href="vegetation.png"/>
<Format>image/png</Format>
</ExternalGraphic>
<Size>15</Size>
</Graphic>
</GraphicFill>
</Fill>

Best Answer

Try to add another PolygonSymbolizer tag inside a rule:

<Rule>
    <PolygonSymbolizer>
  <Fill>
    <CssParameter name="fill">#1e9e1e</CssParameter>
    <CssParameter name="fill-opacity">1</CssParameter>
  </Fill>
  <Stroke>
    <CssParameter name="stroke">#afb38a</CssParameter>
    <CssParameter name="stroke-width">0.1</CssParameter>
  </Stroke>
</PolygonSymbolizer>
<PolygonSymbolizer>
  <Fill>
      <GraphicFill>
        <Graphic>
          <ExternalGraphic>
            <OnlineResource xlink:type="simple" xlink:href="vegetation.png"/>
            <Format>image/png</Format>
          </ExternalGraphic>
          <Size>15</Size>
        </Graphic>
      </GraphicFill>
    </Fill>
</PolygonSymbolizer>
</Rule>

It should work.

Related Question