Skip to content
A BASH script to process Environment Agency LIDAR data and create map tiles of surface features
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit 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. and Place these ZIP files in the same directory as
  • 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 – 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 and run it (./

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

You can’t perform that action at this time.