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...

2

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>
  • Many thanks! I had not noticed the double bracket... Not so intuitive. – wiltomap Jan 25 '17 at 15:57

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.