Wednesday, July 25, 2018

Wonderland Post 2: More Terrain

Terrain Tricks

Two tips that I picked up from Tom Patterson's page on texture shading are texture shading (obviously) and adding other elevation-derived products to the map using transparency (and, if you've got the time/inclination, multiply blend mode in Photoshop/GIMP—paging the ArcGIS Pro developers...).

Tonight we'll explore a couple different products added to our hillshade. First, for reference, is the hillshade placed under the DEM, with some transparency applied to both:


Slope
After some playing around, I've found that slope makes a great addition to hillshades (see my Zions Fireworks post). To generate this, I run gdaldem slope -p dem.tif out.tif, which generates a raster showing percent slope.

In ArcGIS, invert the standard black to white color ramp so that it's now showing white to black, and give it a pretty high transparency value. This adds a little bit of shading to steep slopes, which helps show off all the little nooks and crannies in the terrain:


TPI: Poor Man's Texture Shading
Texture shading was originally developed by Leland Brown and uses a fractional Laplacian operator to generate a raster that gives more of a "ridge and canyon" network feel (see the original paper for more info), with the side effect of calling out great little details if your elevation raster is clean enough/high-res enough.

The texture shading programs provided by Brown take a while to run, and struggle with large rasters. I've found I can get 80% of the way there with the GDAL Topographic Position Index tool: gdaldem TPI dem.tif out.tif. This poster gives more info about what TPI is, but for our purposes it outputs a great raster that can emphasize areas of abrupt topographic change—cliffs, ridges, canyon walls, and the like.

By using a black to white color ramp with the middle grays set to about 75% transparency (so they don't muddle things too much) and the whole layer set to about 80% transparency, this gives a subtle but noticeable improvement to the ridges and small details:


One of the tricks with TPI is that it's scale dependent. As the poster linked above describes, different window sizes give different results. GDAL's utility doesn't allow for changing the window. I'm working on a custom implementation that will allow you to fiddle with this parameter for analytic or artistic purposes.

So, do these additions make a map better? It depends on what you want to show. I like them, but I can see that some people may think it adds too much visual clutter.