Here's a simple way to turn light pollution GeoTIFF data into map tiles using gdal. It's just a small script I made, nothing fancy, but it works!
- Light pollution GeoTIFF data (download for example from here)
gdalmb-util(to convert tiles into a single mbtiles file, install it withpip install mbutil)
- Extract the downloaded GeoTIFF if it's zipped.
- Run the script like this:
./tile.sh World_Atlas_2015.tif colors.txt 3-12 48 output_tilesThis will make tiles for zoom levels 3-12 in the output_tiles folder using 48 threads.
- (optional) Convert your tiles to MBTiles format:
mb-util --silent output_tiles --scheme=tms lightpollution.mbtiles(you need to use --scheme=tms because gdal2tiles outputs already in the XYZ scheme, but mb-utils tries to flip the Y axis again)
That's it! You'll end up with a lightpollution.mbtiles file ready to use.