3D Terrain in Maplibre 2.2

Resources

Mecklenburg Terrain MBTiles
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash

vrtfile=meckdem.vrt
mbtiles=terrain.mbtiles

rm *.vrt
rm *.mbtiles

gdalwarp -r cubicspline -t_srs EPSG:3857 -dstnodata 0 -co COMPRESS=DEFLATE Lidar2017_DEM.tif ${vrtfile}

rio rgbify -b -10000 -i 0.1 --min-z 7 --max-z 13 -j 4 --format webp ${vrtfile} ${mbtiles}

sqlite3 ${mbtiles} 'CREATE UNIQUE INDEX tile_index on tiles (zoom_level, tile_column, tile_row);'