Coder Social home page Coder Social logo

blender_prep's Introduction

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 "blenderize.sh" with your text editor of choice and update the "bounding_box" variable.
    • geojson.io 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 "blenderize.sh". EPSG codes or proj4 strings are acceptable.
  7. Open a command line window, navigate to the project folder, and run: sh blenderize.sh [space-separated list of DEM's] For example: sh blenderize.sh my_dem.tif for just one DEM sh blenderize.sh *.tif for all DEM's in project folder

Notes

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:

blender_prep's People

Contributors

nunderwood6 avatar danieljwood avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.