I have a shapefile data of buildings. I added it to GeoServer and serve it as a WMS layer. When I check my own maps in the browser my polygons of building appear black color and I want to change it's color.

What am I supposed to do ??


Geoserver layers have associated styles. These styles are written in Styled Layer Descriptor (SLD), a subset of XML. To change your styles, you'll have to edit the SLD. In Geoserver, the SLD can be edited using the Style Editor in the Styles Page.

enter image description here

Pretty ain't it? Fortunately, you don't have to edit the Styles by hand. A workaround is to use a GIS package like uDig to style the layers using a GUI. Just load the shapefile in uDig and style as desired. Once you're satisfied, you can export the SLD and upload it to Geoserver. Or you can load open it on a text editor and then copy paste the contents into Geoserver's Style Editor.

Hopefully that should be enough to get you started. If you really want to get your hands dirty though, you might want to check out the SLD Cookbook. It should give you an idea of how to change the SLD by hand. Good luck.


It looks like you are using GeoServer for publish your data. See official GeoServer docs. There is very helpful Introduction to GeoServer workshop from OpenGeo especially Styling section in your case.


If you generate your shapefiles in QGIS, you must save your styles along with the rest of the shapefile.

  1. double click on a vector layer;
  2. select the STYLE tab; LAYER -> PROPERTIES -> STYLE
  3. Click on the STYLES button, lower left;
  4. Save SLD file;
  5. Upload to GeoServer.

Adapted from this answer to a similar question

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.