1

I need to define custom points symbols in a SLD file for GeoServer. It seems that some WKT strings are accepted and others are not. I need to draw a closed line with a fill color.

The following example is accepted (symbols are displayed) but I can't specifiy a fill because it is just a linestring :

<WellKnownName>wkt://MULTILINESTRING((0 0, 0 1), (0 1, 1 1), (1 1, 1 0), (1 0, 0 0))</WellKnownName>

I have tried the followings to be able to fill the shape:

<WellKnownName>wkt://POLYGON(0 0, 0 1, 1 1, 1 0, 0 0)</WellKnownName>
<WellKnownName>wkt://MULTIPOLYGON(0 0, 0 1, 1 1, 1 0, 0 0)</WellKnownName>

The symbols are not displayed and I don't know how to debug it...

1 Answer 1

3

You have the wrong syntax for both polygon and multipolygon, see: https://en.wikipedia.org/wiki/Well-known_text#Geometric_objects

Try:

<WellKnownName>wkt://POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))</WellKnownName>
<WellKnownName>wkt://MULTIPOLYGON(((0 0, 0 1, 1 1, 1 0, 0 0)))</WellKnownName>
1
  • Many thanks! I had not noticed the double bracket... Not so intuitive.
    – wiltomap
    Commented Jan 25, 2017 at 15:57

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.