Wednesday 28 March 2018

Creating tiles in Mapnik



I have installed Mapnik and successfully tested it. Now I am facing the problem of creating my own customized tiles. I have googled it but everywhere it was telling about OSM tile generation.


My vision is simple: I have a huge map data of my target area. I want to create my own custom map in Mapnik/Tilemill. Then create tiles and upload them into server. A step by step instruction would be helpful to me since I am a newbie in Mapnik.


The main problem: How can I create tiles with my own data?



Answer



Like some suggested... I think your path from now should be:



  1. Put data in some format supported by TileMill (if you want simplest, go with shapefiles, otherwise PostGIS database)

  2. In Tilemill, load your data and define the symbolisation for your map, then export a Mapnik XML config file. You can use this XML file together with generate_tiles.py script to create your tiles with Mapnik in the bounding box and zoom levels you specify (to specify bbox, zoomlevels, modify generate_tiles.py, last few lines I think).

  3. You can then use these generated tiles in a web app via OpenLayers or Leaflet.



This is just a rough outline that should get you started, you can ask more specific questions and I'll clarify.



  1. Structure your data

  2. TileMill (GUI + preview of your map)

  3. Mapnik XML export

  4. Mapnik tile generation (actual rendering)

  5. Upload tiles to your server (no need to use mbtiles)

  6. Serve tiles via XYZ or TMS layer in Openlayers


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...