Use Mapbox and display a styled carbon density layer
Description
Use Mapbox to display the carbon densities layer in colors that correspond to the legend style. The web map is set to the default raster projection, albers
.
Steps
-
The initial
carbon-no-w.tif
layer was styled with QGISSymbology
using the Viridis color map and exported ascolor-carbon.tif
. -
Turn the big raster file into a set of smaller, web-friendly tiles. This effectively creates a single SQLite database file that houses all the tiles.
gdal_translate -of MBTILES -co "TILE_FORMAT=PNG" -co "ZOOM_LEVEL_STRATEGY=AUTO" -co "RESAMPLING=BILINEAR" color-carbon.tif color-carbon.mbtiles
- Add extra, lower-resolution versions of the map so that it loads faster when zoomed out.
gdaladdo -r average color-carbon.mbtiles
- Ensure that all of the map's tiles and metadata are in place.
mbtiles validate --agg-hash update color-carbon.mbtiles
A ready-made color-carbon.mbtiles
file was uploaded to project Google Drive.
Test:
Assumes martin is running locally on port 3000
serving the tiles with:
martin /path/to/color-carbon.mbtiles