2

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

3 Answers 3

1

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.

1
  • 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, 2019 at 16:36
0

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

0
0

The documentation says about this issue:

The light-colored borders around the polygons in the figure are artifacts of the renderer caused by the polygons being adjacent.

Seems that there is no other good solution than to dissolve the polygons in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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