Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have downloaded OSM data for our region and loaded them into PostGIS using osm2pgsql. So far so good. On top we have GeoServer and we would like to expose the OSM data using WMS. We would as well like to style data like in "standard" OpenStreetMaps (e.g. as this cartography is well designed. We have tried to download som standard SLD for OSM data, but there seem to all sorts of problems using these SLDs (XML parsing errors, invalid content, etc.).

Any good ideas how to reuse an OSM SLD to style OSM through WMS?




share|improve this question

I have used this one, created (but no longer maintained) by Florent Bervas, and it is quite good. Unfortunately, it only has lines and polygons style, but maybe it will help you.

share|improve this answer
I tried the osm_lines.sld but I get a lot of errors when validating the stylesheet in geoserver's SLD editor. The data was imported to postgis from an osm shapefile extract. Using Geserver 2.1-SNAPSHOT. – maning Nov 28 '11 at 12:47
try to upload without validation. I did not validate the SLD. Just uploaded it, and saved. – Mario Miler Nov 28 '11 at 13:58
Hi, Yes this was exactly my problem - the validation went wrong. I will try and use without validating – user4944 Nov 28 '11 at 14:35

Haven't played with these yet but check out these styles on github

share|improve this answer

They may not be exactly right, but I am working with modified versions of the ones included in OSM-in-a-Box ( A preview is available at that first link.

You can get to the SLDs directly in the source from:

share|improve this answer
That link requires a login. If you could please post the styles somewhere accessible, I'd appreciate it! – Amit Naidu Sep 5 '13 at 21:40
Have a look at my answer here:… No direct link, but accessible with a few steps. Cookies are needed. – AndreJ Sep 11 '13 at 12:56

The map that you can browse on

is quite problably not rendered with geoserver but with a tile server like mapnik instead.

Luckily you can easily (no, seriously) set up a server to render tiles like those on the OSM web site using TileDrawer. Unfortunately at the moment there is an issue that the author is working on that could prevent your setup from working automagically. I suggest you wait until the issue has been fixed. If you can't wait just make sure you install python-cssutils before launching the script.

If you find that TileDrawer takes a lot (like minutes) to render tiles, consider applying the following indexes to the planet_osm database (shameless plug):

share|improve this answer

This rather indirect but what about converting the OSM style file to SLD? There's a tool for converting Mapnik style files to SLD. You might want to consider that option. Good luck. :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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