A BASH script to process Environment Agency LIDAR data and create map tiles of surface features
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



A BASH script which uses GDAL to process the Environment Agency's LIDAR data and create map tiles of surface features which can be viewed in a browser or used in JOSM.

Map tiles are coloured based on the height of surface features such as buildings and trees, calculated by subtracting the DTM from the DSM. By default, features below 1m in height are transparent, becoming red and opaque at 2m. There is a gradient through orange to yellow at 20m, then a more gradual gradient to white at 60m.


Downloading LIDAR data

  • Download one or more ZIP files of LIDAR Composite DSM data and their DTM equivalents from the Environment Agency e.g. LIDAR-DSM-1M-TR15ne.zip and LIDAR-DTM-1M-TR15ne.zip. Place these ZIP files in the same directory as lidar2tiles.sh.
  • If multiple resolutions of the same area are provided, the script will combine them, favouring higher-resolution data.
  • You may find the index shapefiles – which can be downloaded from data.gov.uk – helpful in determining which resolutions to download.

Altering the colour map (optional)

  • If you wish, alter the colour map by editing colourmap.txt. See the gdaldem documentation for details. N.B. colourmap.txt uses alpha values in addition to RGB values.

Running the script

  • cd to the directory containing lidar2tiles.sh and run it (./lidar2tiles.sh).

Using the output files

  • The map tiles are placed in the tiles directory. Within this directory, leaflet.html can be used to browse the tiles.
  • The TIFF and VRT files created are not required but can be loaded into QGIS if you wish to examine the data to determine building heights, for example.
  • To use the tiles in JOSM, click on Imagery > Imagery Preferences, click on the '+ TMS' button and enter the URL e.g. file:///home/user/Desktop/lidar2tiles/tiles/{zoom}/{x}/{-y}.png (note the -y) and a name for the layer. The layer will appear in the Imagery menu.


Copyright © gregrs-uk 2017, published under the GNU GPL v3.0