[GIS] Map tiles rendering from local map server to disk

generate-tilesmapserveropenstreetmaptiles

I am looking for a solution for following use-case:

  1. I need to run a local map server using OpenStreetMap (OSM) data
  2. Map server needs to be able to render a set of map tiles to local directory on disk(TMS scheme)
  3. Input parameters for tile rendering should be GPS bounds of certain area and zoom levels.

Is there a way to achieve something like this using MapServer?

Best Answer

The most common way to style OpenStreetMap data is with a Mapnik stylesheet. I'm going to assume you're doing so here.

There are a number of different pieces of software that handle rendering tiles with Mapnik and could meet your needs. Three popular ones are

  1. Tilemill

    Tilemill is designed for developing map styles, but also allows you export tiles for a bounding box in a format like .mbtiles, which can then be expanded to files on disk with mbutil. You can only export to a bounding box, not an arbitrary polygon.

  2. renderd

    Renderd is probably the most popular software for rendering tiles with OSM data from Mapnik. It comes with render_list, which allows you to render either an area, or a list of tiles. You can then convert the meta-tiles stored on disk to tiles in a TMS scheme. Renderd comes with invalidation options suited for frequently changing OpenStreetMap data. You could slice your polygon into a couple bounding boxes, or give a list of tiles.

  3. mapproxy

    Mapproxy does not come with the invalidation options of renderd, but you could set up a cache of files with a TMS structure on-disk and render an arbitrary polygon between given zoom levels.

I would probably use Tilemill myself, unless I had a large area which I didn't want to render as a bounding box, but needed an arbitrary polygon.