0

I am trying to create an SLD in GeoServer for a vector grid that will not show boundaries between contiguous polygons that are the same color. It seems that no matter how I style the strokes, I cannot completely remove the boundary.

The fill needs to be 0.5 opacity and I think that prevents me from going the route of styling the stroke the same color, since it appears to overlap and create a darker boundary. Setting the stroke width and opacity to "0" still leaves artifacts on the boundary edges. Removing styling for the stroke renders the same as if I set the stroke width or opacity to "0".

There are examples of each scenario below. Does anyone know how I remove the artifacts between the polygons?

Stroke width=0, opacity=0

Style

<PolygonSymbolizer>
  <Fill>
    <CssParameter name="fill">#54278F</CssParameter>
    <CssParameter name="fill-opacity">0.5</CssParameter>
  </Fill>
  <Stroke>
    <CssParameter name="stroke">#54278F</CssParameter>
    <CssParameter name="stroke-width">0</CssParameter>
    <CssParameter name="stroke-opacity">0.0</CssParameter>
  </Stroke>    
</PolygonSymbolizer>

Rendering

enter image description here

Stroke width=1, same fill color and opacity

Style

<PolygonSymbolizer>
  <Fill>
    <CssParameter name="fill">#54278F</CssParameter>
    <CssParameter name="fill-opacity">0.5</CssParameter>
  </Fill>
  <Stroke>
    <CssParameter name="stroke">#54278F</CssParameter>
    <CssParameter name="stroke-width">1</CssParameter>
    <CssParameter name="stroke-opacity">0.5</CssParameter>
  </Stroke>    
</PolygonSymbolizer>

Rendering

enter image description here

0

There are two possibilities neither of which are great.

  1. Merge your polygons and colour the big one with no strokes in it

  2. You might get away with setting your stroke opacity to .25 so the overlaps come out to .5, but the corners may still look funny.

  • Thanks for you answer. Unfortunately the overhead of additional processing of the data is not possible for our use case. I did try playing with opacity, but even adjusting down to 0.05 still created darker lines. – philnug Jan 23 at 16:36
0

According to my knowledge, it would be better that you keep both line and background color of same color.

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.