I am trying to style the GeoServer layer. I have the shapefile with multi polygon feature into it and in the attributes, I have the x, y(centroid of each polygon) where I need to plot the marker or circle feature.

How can I get the feature from the shapefile in sld file and draw the marker with respect to it?

  • 1
    Just use a pointsymbolizer either on your polygons or the centroid point.
    – Ian Turton
    Commented Jan 7, 2022 at 16:37
  • I am not able to figure out. Can you please give an sample sld file
    – Piyush
    Commented Jan 7, 2022 at 19:30
  • As per the help center please do not include chit chit like thanks and other statements of appreciation within your posts.
    – PolyGeo
    Commented Jan 7, 2022 at 21:14

1 Answer 1


As described in the SLD Cookbook you can draw a circle or a graphic on a point or the centroid of a line or polygon.

If for some reason you need to use a point created from 2 numeric columns you would need to make use of the geomFromWKT function to create the point in a <Geometery> block of the Symbolizer.

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.