I have a set of shapefiles loaded to GeoServer, which I later deliver as a WMS. All the shape files are rendered in the same neutral grey, which makes it quite difficult to tell apart which shape file I'm visualizing. Can I assign colours of textures to each polygon?

A very similar question was posted earlier. But, since the user relied on ESRI technology, all answers focused on ESRI solutions; not GeoServer. Control the colors of a shapefile

The question linked to mark mine as duplicate is a different question; even if both answers happen to be in the same manual. I want to give a colour to each shapefile. While the other question was about assigning colours based on the value of a field.

  • 2
    Why not to read the GeoServer documents docs.geoserver.org/stable/en/user/styling/sld/index.html?
    – user30184
    Aug 21, 2020 at 7:53
  • 1
    Note that you don't serve shapefiles using a WMS, you serve images created from the shapefile data.
    – nmtoken
    Aug 21, 2020 at 10:17
  • 1
    For a WMS with vector data input (e.g. in your example a shapefile) it doesn't matter if your input shapefiles have colour from say a layer file, (as per the link in your Q) that information is discounted. You must use the built in methods of the WMS server software, for example SLD, to style the output image, whether you style the whole image one colour or colour by attributes.
    – nmtoken
    Aug 21, 2020 at 14:48

1 Answer 1


You can control the colours and textures using styles. https://docs.geoserver.org/stable/en/user/styling/webadmin/index.html

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