Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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. osm.org) 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?

Thanks!

Regs.

Ulrik

share|improve this question
add comment

5 Answers

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
add comment

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

share|improve this answer
add comment

They may not be exactly right, but I am working with modified versions of the ones included in OSM-in-a-Box (http://dev.ifs.hsr.ch/redmine/projects/osminabox/wiki). A preview is available at that first link.

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

http://dev.ifs.hsr.ch/redmine/projects/osminabox/repository/revisions/master/show/Code/osm2gis/geoserver/geoserver_data/styles

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
1  
Have a look at my answer here: gis.stackexchange.com/questions/70641/… No direct link, but accessible with a few steps. Cookies are needed. –  Andre Joost Sep 11 '13 at 12:56
add comment

The map that you can browse on

http://www.openstreetmap.org/

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):

http://unicolet.blogspot.it/2012/06/improving-tiledrawer-rendering-speed.html

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.