[GIS] QGIS Project to MBTILES / SLIPPY MAPS

exportmbtilesqgistiles

Assuming you have 20+ Qgis projects each with dozens of layers:

  • Background: Web Map Tiles,
  • Features: Millions of Polygons & Points
  • Features are labeled, labels are never overlapping with each other
  • Styled to look perfect in any zoom Layer
  • Gives perfect results if printed out via the composer as atlas

Problem: If you want to convert the whole project with right this styling into MBTILES or Slippy Maps, what is the best solution ?

I spend for 4days testing and failing with:

  • QTiles (Problems with Labels, which occur in every Tile, slow)
  • QMetatiles (Crashes very often while saving directly to mbtiles, slow)
  • Converting an Atlas as GeoTIFF via GDAL2MBT to MBTILES (unstable, labouros if you have many projects)
  • Setting up a QGIS WMS Server and reading the tiles with the Mobile Atlas Creator (labourous if you have many projects and unstable)

Is there a universal, robust solution to export the QGIS Canvas to Tiles, fast (like a "Save As …" Button)?

After reading every google result twice, testing many github tools, I'm blind or searched the wrong keywords. I'm open for obvious and strange suggestions, as long as it doesn't involve a reprogramming for every export.

Best Answer

The "tile_writer" python application by Alexander Hajnal works very well, at least up to QGIS version 2.18. It does not cut labels and is fast compared to QTiles:

http://alephnull.net/software/gis/tile_writer.shtml

Some users have difficulty getting the globalmercator module to load, but this can be resolved by entering a command into the python console, which will direct the script to the folder where both the module and the main script are stored:

sys.path.append("YOUR-PATH-HERE/tile_writer.0.2.1")

Press ENTER and then follow with this command:

import globalmercator

Note that the above steps should be performed after you try to launch the program in the normal way.

It's not fast like "SAVE AS" but it is currently the best way I know to produce map tiles from QGIS.