Fresh Sentinel-2 in your editors. With QGIS, but easier

Posted by TrickyFoxy on 8/2/2023

It seems that there is only one instruction for getting fresh Sentinel-2. It tells you quite well how to prepare images, but it is difficult to explain how to use them in OSM editors. So after step 7, you can do

without GeoTIFF and tile server

  1. Select in QGIS: Processing->Toolbox->Raster Tools->Generate XYZ tiles (MBTiles)
  2. Set the parameters:
    • to Extent of the map area you need.
    • Maximum Zoom is most likely 15.
    • In Output Path, specify where to save the tile file
  3. Click Run and wait for rendering to finish.
  4. Install the mbtiles plugin in JOSM
  5. Open the file you received in step 3.

By the way, recently Guru Maps learned how to tear off MBtiles https://gurumaps.app/blog/2023/06/14/mbtiles


But if you still want a tile server, you can do without tileserver-php from the instructions. And without the QTiles plugin, it will also work faster!

Classic tiles with a web server

  1. Select in QGIS: Processing->Toolbox->Raster Tools->Generate XYZ tiles (Directory)
  2. Set the parameters:
    • to Extent of the map area you need.
    • Maximum Zoom is most likely 15.
    • Set Output Directory. You can immediately select the directory of your web server.
  3. Click Run and wait for rendering to finish.
  4. Start your web server. If you didn’t use Nginx or Apache, open the folder with your tiles in the terminal and try using the web server in Python: python -m http.server 80 or PHP: php -S 127.0.0.1:80
  5. In JOSM, open Preferences->Layers->+TMS
  6. Enter a URL like this: http://localhost/<tile folder name>/{zoom}/{x}/{y}.png
  7. Get closer to the desired area in JOSM and select your new layer from the Layers menu.

p. s. I used QGIS 3.32.1-Lima.


upd: method from @maraf24

Classic tiles for JOSM without a web server

Instead of starting the web server, specify the following URL in JOSM: file://<absolute path to the folder with tiles>/{zoom}/{x}/{y}.png