Skip to content

nrenner/leaflet-raw-dem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaflet-raw-DEM

A first attempt at reading and visualizing raw elevation data with Leaflet using Canvas.

Supports reading zipped DEM (Digital Elevation Model) files in the ESRI BIL (Band interleaved by line) raster format (single band only), e.g. as provided by USGS EarthExplorer for SRTM 1 Arc-Second Global.

Renders the data as raster grid, similar (yet very basic) to what desktop GIS like QGIS and uDig do, but in the Browser. With elevation labels on high zooms.

File viewer:

Examples:

  • example/mallorca.html - detail (building)
    Two SRTM 1-arc v3 files (1.9 MB and 2.5 MB) as example, loading may takes a few seconds
  • example/clip.html
    Minimal example using a 6*3 grid sample file, no extra dependencies, for development

Status

A work in progress on hold, known issues, needs validation and testing. Provided as is, not sure if continued or maintained (low priority).

See also for alternatives.

Limitations

  • only single band BIL files supported
  • assuming 16-bit signed integers and Little-endian (Intel) byte-order
  • Spherical Mercator (EPSG 3857) only (?)
  • only linear color scale supported right now
  • ...

Known issues

  • border artefacts
  • viewport not always fully covered at last row/column
  • ...

Usage

Convert other formats to BIL using gdal_translate with the GDAL EHdr format, e.g.:

mkdir tmp
gdal_translate -of EHdr srtm_37_05/srtm_37_05.tif tmp/srtm_37_05.bil
zip -j srtm_37_05_bil.zip tmp/*
rm -r tmp

Build

Requires Node and npm (or io.js), Bower and Gulp:

npm install -g bower
npm install -g gulp

Install:

npm install
bower install

Build:

gulp

Develop:

gulp watch

To-do

  • hgt format (basically the same with the header derived from the file name)
  • Web Worker
  • autoScale/stats across multiple layers
  • ...

See also

OpenLayers

More

License

Copyright (c) 2015 Norbert Renner, licensed under the MIT License (MIT)

About

Reads and visualizes raw elevation data with Leaflet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published