My target is to have the whole planet to be available in the map client[leaflet.js/openlayers.js] but only a specific country loaded with roads etc.

I have followed the steps below to setup my Geoserver (2.7.1) with OpenStreetMaps:

  1. Downloaded the shape files for a country [e.g. http://download.geofabrik.de/europe/czech-republic-latest.shp.zip] and uploaded them to Geoserver.
  2. Downloaded the land polygons [http://data.openstreetmapdata.com/land-polygons-split-4326.zip] and uploaded them to GeoServer.
  3. Downloaded the mapnik styles[http://svn.openstreetmap.org/applications/rendering/mapnik], converted them with mapnik2geotools and uploaded them with it using the rest services option.

When visiting the Layer Preview and select the land-polygons layer it displays fine with zooming going all the way. When I assign the world style to this layer the zooming is not quite going all the way down and after some zooming point the map is blank.

On top of that, when I add the road layer and assign the mapnik converted road style as its default nothing gets rendered. The layer and the whole map is just blank. The documentation says that this is most probably because there are semantic errors in the styles.

What am I doing wrong? Can anyone let me know of any current OSM Geoserver ready styles I could use? Which one of the two (Mercado or 4326) projections would you recommend? Should I just go for another map server which is straight away compatible with OpenStreeMap data and mapnik styles?

  • 1
    Not answering the question, but you almost certainly don't want to use shapefiles for the world. Consider using a database backend: postgis.
    – BradHards
    Aug 4, 2015 at 9:40
  • 1
    The Mapnik styles rely on the schemata and attributes of the tables which are created with osm2pgsql utility from the native OSM data in XML or PBF format. Otherwise shapefiles for the Czech republic only would not be a bad option @BradHards.
    – user30184
    Aug 4, 2015 at 10:06
  • 1
    I want the maps to look as close to OpenStreetMap but thus far I am failing big time. Any thorough steps to do it? I tried postgis with the country I wanted but now I have less shapes. The land_polygons layer still does not zoom properly if I use the "world" style causing the map to become blank after some point.
    – Timmo
    Aug 4, 2015 at 12:07
  • 1
    OK I fixed the zooming problem by removing the MaxScaleDenominator elements from the styles but still roads are missing, road labels are missing etc
    – Timmo
    Aug 4, 2015 at 13:16
  • 1
    I went for the tile_mod (mapnik) and PostGIS and everything seems to work fine and for now it is adequate for me
    – Timmo
    Aug 7, 2015 at 14:55

1 Answer 1


This is a presentation explaining how to load and style OSM data into GeoServer 2.16: https://media.ccc.de/v/bucharest-245-standing-up-a-osm-clone-with-geoserver-and-css

The code referenced in the presentation is available at: https://github.com/geosolutions-it/osm-styles

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.