User:Ff5722/How to create and host tilesets from GeoTIFF images

From OpenStreetMap Wiki
Jump to: navigation, search


  • Install an local web server such as WampServer or XAMPP
  • Follow the instructions here to set up TileServer-php to be hosted on your local server (so, place the tileserver folder in the 'www' or 'htdocs' folder of Wamp or XAMPP).
  • Redirect your localhost domain to a virtual domain. [1] (this is needed because JOSM doesn't accept background imagery hosted at localhost)
  • Start the Apache server. Go to the tileserver page (http://localhost/tileserver). Verify that your virtual domain is working, by going directly to yourdomain.example/tileserver and not localhost/tileserver.
  • Right click the WMTS link on the right side and copy the URL. In JOSM add this URL as a WMTS server (for example http://ff5722.local/tileserver/wmts).
  • Open QGIS (you need QGIS 2.8 or earlier, because the Qtiles plugin is not available for QGIS 3.0) and go to Plugins > Manage and install plugins. In the Plugins window, go to Settings and enable 'Show also experimental plugins'. Click reload repository. From 'All' search for the 'QTiles' plugin by NextGIS and install it.


  • Start the Apache server
  • Open your GeoTIFF in QGIS (Layer > Add layer > Add raster layer).
  • Go to Plugins > QTiles and open the QTiles window.
  • I recommend only generating tiles up to zoom level 16 or less for Sentinel-2 (10 meter resolution), change the zoom level accordingly for higher or lower resolution imagery.
  • Saving the tiles to an SSD instead of to a mechanical HDD speeds up the process.
  • You don't need a very powerful CPU, I use a Pentium G4560, and generating tiles for one Sentinel-2 granule of about 50x50 km up to zoom level 16 takes around 10 minutes.
  • You can also generate tiles for only part of a GeoTIFF image. To do this, in QGIS, choose from the menu Raster > Extraction > Clipper. Save as a new file (e.g. crop.tif). Then in the Qtiles window, select the cropped layer.
  • Rename the JSON file to metadata.json and place it in the same folder as the tiles.
  • In JOSM, select your custom WMTS server and start tracing

Note: you can start tracing while the tiles are being generated, the processing starts from top left of the tile.