How can we add category based styling to geometry point my application show geoserver rendered map, and all the map POI are directly fetched from database and shown to the map.i need know how we can add different style for different points please help me

database used is POSTGIS


1 Answer 1


There are several options I can think of, but there are probably more and better ways to do it.

  1. Depending on how many styles you need, you could create a new rule for each style you need. Set a filter on each type of style like this:

  2. You also use the database to color you POI's differently. You can fill your database with HEX colors and tell the SLD to use it like this:

        <CssParameter name="fill">

You can also look at http://osgeo-org.1560.x6.nabble.com/SLD-for-attribute-based-polygon-td3789822.html

I have tried to do this with the "WellKNownName" shapes, but this has failed.

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.