Search code examples
openstreetmapmapnikcartocss

How to limit geodata to cities and railways in Mapnik?


I have successfully set up a working mapnik tile server under Ubuntu 14.04 using the OSMBright style. For testing purposes, I downloaded and imported the geodata for Luxembourg. The file was only 16MB in size and the import only took a minute.

Next, I wanted to add the geodata for Germany, which is way bigger (about 4GB). During the import, I ran out of disk space (which was quite sparse because I had to use a VM at work).

For our purpose, we actually only need railway lines, stations and cities without any more detail such as individual houses, streets, other POI's. As a beginner with OSM and Mapnik server: is there a way to omit unneccessary data when importing geodata in order to minimize the required resources? Or can I only create a style that does not display the unneccessary things (which wouldn't save disk space but would probably increase performance)?


Solution

  • Please see osmosis and osmfilter for filtering data after downloading and Overpass API for filtering data before downloading.

    For the appropriate tags see the wiki pages about railways, stations and cities. Maybe you are interested in landuse and administrative boundaries, too.