![]() |
||||||||||||||
![]() |
||||||||||||||
| Edition 12, November 2012 | ||||||||||||||
Working In GDAL (WIG) – Creating a Topographic Position Index MapIn this monthly series, I turn my attention to one of the most powerful software packages for raster processing available – the Geospatial Data Abstraction Library (GDAL) – and as an added bonus, it’s free! Each month, I focus on a different utility offered in GDAL, walking the reader through its applications and offering up a series of tips and illustrations so that you can emulate this process in your office and/or home. In this edition of WIG, I show our readers how to use GDAL to create a topographic position index (TPI) map from a raster digital elevation model (DEM). About GDALGDAL is an open source software application that was launched in 1998 and has been updated multiple times since. While the current version of GDAL (i.e. version 1.9) can be downloaded from multiple locations, I find this site to be the most up-to-date and easy to navigate. I suggest downloading the stable version of the MSVC2010 build for either 32-bit or 64-bit PCs depending on which you have access to. You can also download GDAL as part of an easier to install program, FW Tools, but the version of GDAL included with this installer is usually not the most recent. GDAL contains a wide array of utilities to help you process raster files. I find that GDAL is more stable and runs quicker than ArcGIS, ENVI and PCI for data production – although the toolkit is more limited than in these applications. GDAL does not rate high for user-friendly functionality as it is command line driven (i.e. words and text, not graphics and mouse clicks); and this is the inspiration for creating the WIG series. What is the Topographic Position Index (TPI)?The topographic position index is a relative measure of a location’s elevation with respect to its surroundings. It is calculated in GDAL by subtracting the mean elevation of the 8 cells surrounding a central location from the central location’s elevation. Given that TPI is calculated by comparing a central point to the mean, surrounding elevation, there are negative values unlike the terrain roughness index which I wrote about last month. Here is a quick summary of how you can interpret TPI values:
It is also important to note that TPI is scale-dependent in that you can compare a central point to the mean elevation of just the 8 immediate surrounding pixels (as is done in GDAL); or you can compare this pixel, for example, to the 5 closest neighbors in all directions. By alternating the radius of the mean elevation calculation, you can identify either fine or large scale features. In GDAL, you will be locked into identifying fine scale features such as ditches and mountain peaks given that it will only calculated TPI with a 1-pixel radius (i.e. a central point’s 8 immediate neighbors). Creating a Topographic Position Index MapIn order to create a TRI map from a DEM, I employed the GDALDEM functions – you can find out more about them here. Here are the steps I took to create this layer:
Tips for Interpreting and Working with TPI Maps in ArcGISAs has been the trend with these WIG pieces, creating symbology in ArcGIS required to interpret an output from GDAL is a multi-step process. The first step in the process is determining the maximum and minimum range for TPI. I will follow the same general procedure set out in previous WIGs to determine this. As TPI has both negative and positive values, that will add an extra wrinkle to this process from what I presented last month. As such, I created a short video tutorial using ArcMAP 10.1 to show you the steps I use.
Click the image above to see a short tutorial of the process to determine the maximum and minimum values of your TPI in ArcMAP 10.1.
Now that you have seen how to determine your maximum and minimum values for TPI, it is time to move on to creating a color scheme that helps us locate fine geologic structures. To do this, you will want to right click on your TPI layer and go to Properties -> Symbology -> Classified. From here, click on the Set Exclusions… button and enter the correct expression to exclude the values above and below your true TPI range. What you are trying to do here is exclude the ‘fake’ TPI data that is created by GDAL at the borders of your raster. For my exclusions, I used this expression: -16500 - -0.697, 0.725 - 20600 To create a color scheme that helps find fine features, it makes sense to use a Classified technique whereby ranges of TPI values are represented by easy to spot colors. You can do this from the same menu as the exclusions were entered into, i.e. Properties -> Symbology -> Classified. To do this, I ran multiple classifications offered in the pull down menu with 5 classes; and I found that Natural Breaks (Jenks) made the most intuitive sense with my data. From there, I hit the Classify... button and changed the Break Value closest to zero to exactly 0.0. What this did is create two categories of TPI with positive values (i.e. hills) and then three with negative values (i.e. gullies). I then selected a simple color ramp of red to green so that the colors red, orange and yellow were negative; and then dark and light green were positive. As a final step, I added high resolution imagery available through the ArcMap 10.x basemap menu to help bring the TPI map to life so to speak. The animation below shows the result of this color scheme and base layer imagery. By using this combination, I could identify thin ridges and gullies as well as roads that might have been missed by inspecting the high resolution imagery and/or elevation data on its own.
Click the image above to see an animation of the TPI I created from a 2-meter DTM over laying high resolution imagery. Red represents the most negative TPI values, while green represents the most positive. This visualization scheme for the TPI helps to reveal small features you might miss in a DEM and/or imagery by themselves. (DTM Source: DigitalGlobe)
Brock Adam McCarty |
||||||||||||||
|
||||||||||||||
![]() |
||||||||||||||