Skip to content

Using LERC Cogs directly in maplibre as raster-dem sources

Notifications You must be signed in to change notification settings

blacha/lerc-cog-maplibre

Repository files navigation

LERC COGs as Maplibre DEM source

Example render

Grab some elevation data eg https://data.linz.govt.nz/layer/107436-taranaki-lidar-1m-dem-2021/

Make VRT

gdalbuildvrt ../BJ29.vrt *.tif

Create a 3857 LERC COG

 gdal_translate -of COG \
    -co TILING_SCHEME=GoogleMapsCompatible \
    -co NUM_THREADS=ALL_CPUS \
    -co BIGTIFF=NO \
    -co ADD_ALPHA=YES \
    -co BLOCKSIZE=256 \
    -co SPARSE_OK=YES  \
    -co compress=lerc -co max_z_error=0.01 \ # 1cm of error
    BJ29.vrt BJ29.lerc.cog.tiff

bundle everything

npm i
npm run bundle

Start a local webserver

serve .
open http://localhost:3000

About

Using LERC Cogs directly in maplibre as raster-dem sources

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published