Script to expedite preparing DEM's for Blender.
Go to file
Nick Underwood 13b5d8f486
Merge pull request #2 from DanielJWood/update
Cleanup and adding note on GDAL python from D. Wood
2020-01-31 10:13:34 -06:00
.gitignore remove .DS_Store, add .gitignore 2019-11-25 15:06:45 -05:00 update readme with python module req, formatting 2019-11-25 15:30:45 -05:00 Specify bilinear resampling for cropping 2019-10-23 22:06:24 -05:00

Presented at NACIS 2019 Tacoma


Script to expedite preparing DEM's for Blender.

As described in Daniel Huffman's Creating Shaded Relief in Blender, significant work is necessary to find and prepare elevation data prior to rendering it in Blender. This work often includes mosaicing, reprojecting, clipping, resampling, rescaling, and translating DEM's(digital elevation models). While some of these steps require decisions specific to the project, many are repetitive. This repo contains a bash script which utilizes open source command line tools to expedite this work.

How to Use

  1. Clone/download the repo.
  2. Make sure GDAL/OGR is installed. (gdalinfo --version)
  3. Make sure the GDAL/OGR python module is installed.
  4. Create a vector specifying your area of interest and add to the project folder. Default points to "box.geojson"- to update, open "" with your text editor of choice and update the "bounding_box" variable.
    • is a useful tool for building a simple rectangular bounding box in the correct geojson format.
  5. Find and download DEM(s) which cover at least your area of interest. Err on the side of including more than you think you might need. Add your DEM's to the project folder.
  6. Specify your target projection by updating the "target_projection" variable in "". EPSG codes or proj4 strings are acceptable.
  7. Open a command line window, navigate to the project folder, and run: sh [space-separated list of DEM's] For example: sh my_dem.tif for just one DEM sh *.tif for all DEM's in project folder


By default, the script will mosaic (if there are multiple dems), reproject to your target projection, clip to your bounding box, and output a TIF with 16-bit unsigned integer values, scaled from 0 to 65,535. The script does not resample the DEM, instead retaining the full resolution of the input data. If I want to quickly resample my elevation data, I just pull the output into photoshop and make sure to resize with resampling set to cubic or bilinear. Here's a couple good resources for more on generalizing elevation data for hillshading: