In 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 terrain roughness index (TRI) map from a raster digital elevation model (DEM).
About GDAL
GDAL 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 Terrain Roughness Index?
Of all the GDAL commands I have discussed in the past editions of WIG, the TRI is by far the straightest forward to understand the mathematics and principles behind it. A TRI shows you how rough an area is as measured by changes in elevation from a central point to those that surround it. This roughness value is calculated using matrix math whereby the elevation of central point in a DEM is compared to the 8 neighboring pixels; the absolute value of each elevation difference is then summed and divided by 8 (i.e. an average is determined). Since TRI employs an absolute value in the average calculation, TRI is never less than 0. An area with a 0 value for TRI shows that the central point and its 8 neighbors have the exact same elevation or it is completely flat. As the TRI value grows, a landscape becomes more rough or undulating.
It should be noted that the range of TRI values is tied to the resolution of your input DEM. In that an elevation model with larger resolution can show more change from pixel to pixel as more ground is covered in a 10-meter DEM versus a 1-meter DEM, for example. As such, TRI should be thought of as a relative index to compare roughness within the same DEM as opposed to an absolute index to compare roughness across several DEMs with varying resolutions.
Creating a Terrain Roughness Index
In 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 calculate a hillshade:
- I moved my DEM file, a digital terrain model (DTM) produced by DigitalGlobe with 2-meter resolution over Gadara, India, to a folder called, ‘Test,’ located the root of my C: Drive
- I chose a simple folder name and file location (i.e. C:test) for the data to make things easier when working with the command line interface of GDAL
- I also changed the name of the DTM file to ‘DTM.tif’ to make things easier when working with GDAL
- After starting up GDAL, I used the command: cdtest
- This command points GDAL to the folder I created with the DTM
- If you would like to get a list of the files in the folder you are working in, use this command: dir
- To calculate TRI, I used the following command: gdaldem TRI DTM.tif TRI.tif
- In this command, the words ‘gdaldem TRI’ define the utility that GDAL uses to process the data
- ‘DTM.tif’ is the full name of the input (original) DEM file
- ‘TRI.tif’ is the name of the text-based file that will define my output color schema; creating this file is by far the most challenging part of the color relief command, and as such, is the focus of the remainder of the piece below
- There is no extra functionality commands that can be added to TRI in GDAL
- However you can change the file extension of the output file from TIFF (.tif) to any raster format that GDAL supports
Tips for Interpreting and Working with TRI Maps in ArcGIS
Similar to the other elevation-derived datasets we have created with GDAL, when you move over to ArcGIS to work with TRI data, creating a symbology schema is not as straight forward as we might like. One of the biggest challenges of viewing this data is that GDAL calculates TRI values at the edges of your elevation model even if that only contains black fill (or no data values). In order to overcome this, we need to get a sense of the maximum and minimum values for TRI.
To determine the minimum is easy, that is 0, as by definition you will never get negative TRI values. To determine the maximum values, you will want to follow the same steps put forth in last month’s WIG as related to building and viewing histogram values accessed under the menu chain, Properties -> Symbology -> Classified. When you open these histograms, you will likely see a wide range of values for TRI; the ‘true’ values will be clustered close to the 0 bar on its right side (you can see an example of what to look for in the screengrabs below). Once you zoom in on these values, you can move the right slider bar on the histogram graph to find the maximum value. You will know you found the maximum value when the number elements on the bottom right of the graph screen stop moving. I found a range of values from 0 to 1.749 for TRI.
When I created symbology for my TRI map, I wanted four color classes that ranged from green (flat areas) to red (steepest areas) in order to make the information displayed in ArcGIS more intuitive. To do this, right click on your layer, go to Properties Symbology Classified. I chose four classes with a red to green color ramp. Now you need to ignore the TRI values that are found in your black fill areas. To do this, click on the Classify… button and then Exclusions, I used a range of 1.75-21000. This causes your black fill borders to have the same color as the lowest TRI class you create, so be wary of this when you interpret the map you have created.
TRI as a Link Between Human, Animal and Physical Geography
As a geographer, I cannot help but have interest in the link between human/animal and physical geography; and TRI is an instance where geospatial information shows a strong link between the two. For instance, many scientists have established that rough lands (i.e. hills and mountains) will lower regional incomes as it is more expensive to build, farm, grow, etc. on hills and mountains than it is on flat coastal plains. In Africa, Nunn and Puga postulate that while rough lands had a direct negative impact on income growth, they suggest that it had a net overall positive impact on development by protecting many of the internal inhabitants of the continent from the Slave Trade that lasted from the 1400s to ~1900 (see Nunn and Puga, NBER Working Paper 14918, April 2009). Burchfield et al. theorize that rolling hills encourage scattered human development in areas where things are more flat; while areas with mountain ranges at the fringes encourage compact development of available flat areas (see Burchfield et al., Causes of Sprawl, Quarterly Journal of Economics, Volume 121, Issue 2). In animals, TRI has been linked to population density as it can influence the quality of the local habitat (see Utah Cougar Management Plan, V. 1, Jan 27, 1999).
So when I created my own TRI map over a rural area in India, I had to satisfy my curiosity to see if the TRI map bore out similar linkages. And the answer to that appears to be a resounding yes. In the animations that follow, you will see that human development is located in flatter areas with trees occupying the steepest slopes on their own. Ah, the joys and wonders of geography!
Click the images above to see animations of the TRI map I created above overlain on high resolution satellite imagery that can be found in Esri’s base layers. The first animation shows a flatter area while the second shows an area with much greater relief. It should be noted that human development will often create flatter areas on the lands they disturb. (DTM Source: DigitalGlobe; Imagery Source: Esri)
Brock Adam McCarty
Map Wizard
(720) 470-7988
Are you a regular user of Landsat satellite imagery? Or perhaps you are interested in looking at changes in our landscape since 1999? If so, the recently launched USGS LandsatLook Viewer is the website for you! By far, this is the most user friendly interface I have seen yet that lets you browse Landsat data from any location on the planet online with full resolution previews; as well as select tiles to download in TIFF format for your own offline projects.
Browsing imagery online is a relatively intuitive process with the large Select Scenes button and the time slider; what is not as easy to figure out perhaps is how to download the raw Landsat files. Once you have selected the location you are interested in and then pressed the Select Scenes button, you can download data by:
- Pressing the Table button, selecting the scenes you want with the Checkboxes and then pressing the Add to Cart button.
- An alternative way to select scenes for download is to do this one at a time by viewing the image you like online, pressing the Metadata button and then Add to Cart.
- Once you have selected the scenes you want to download, be sure you are looking at the Table, then switch the pull down menu at the top left to, Showing: Cart; now select all the scenes you want to download from the list and press the button Get Landsat Data.
Other great features of this online Landsat viewer include:
- An advanced query that lets you set the date range to search; the Landsat sensors to include in the search; and the maximum cloud cover.
- The ability to apply several stretches to online previews to get a better look at the imagery.
- A transparency setting to see the road and/or topographic map below.
Several basemaps that you can toggle between.
Until my next edition of Free For All!, happy hunting for free GIS data!
Brock Adam McCarty
Map Wizard
(720) 470-7988
Have you had a chance to test out our new online imagery search engine, Image Hunter?
If not, give it a test drive now as all orders placed with Image Hunter will receive a 5% discount during the month of October 2012!
Image Hunter can be accessed 24 hours a day, 7 days a week and is a one-stop shop for every major source of medium and high resolution satellite imagery on the market today, including:
- WorldView-2
- QuickBird
- WorldView-1
- GeoEye-1
- IKONOS
- Pléiades 1A (coming soon)
- The SPOT constellation (coming soon)
If any of our readers have struggled with other geospatial search engines that are clunky; only query one data source; and/or do not provide preview images, then Image Hunter is the solution to your woes, as it features:
- Near-instantaneous loading of low resolution preview imagery with associated collection date and key metadata
- Ability to define your area of interest by address and with coordinates, geometric shape or shapefile/KMZ
- Responsive base layer with street names and imagery to provide a spatial context when discovering data
- Online ordering of satellite imagery from 3 data providers and 7 constellations
- Global coverage with tools to measure distance and create annotated maps
During the month of September, we made several important upgrades:
- Latitude and longitude coordinates displayed in Image Hunter are now in decimal degrees format so they are easier to work with.
- We improved the handling of extremely complex shapefiles, including auto-simplification of polygons that would cause issues with Image Hunter’s functionality.
Image Hunter can be accessed here. If you would like a Quick Start Guide to get up and running, it can be downloaded here. We are excited to find out what you think about Image Hunter and any ideas you might have to improve the user experience–we can be reached anytime at (303) 993-3863 or at sales@apollomapping.com with these suggestions.
Posted on September 13th by Astrium Services, the 1.5-meter natural color image of Bora Bora is impressive to say the least–especially given that SPOT 6 launched into space just 3 days earlier!
We are excited about the possibilities of SPOT 6 when you consider: (1) it can image up to 3 million square kilometers per day; (2) its 60-km wide footprint; and (3) its ability to produce 1.5-meter true natural color images. SPOT 6 also features a blue spectral band which is the first time for a SPOT satellite. When SPOT 7 joins its twin in space during 2014, the constellation will provide daily revisits to every location on the planet with 6 million sq km of collection capacity per day.
- The SPOT 6 Earth observation satellite, built by Astrium, was successfully launched.
- SPOT 6 joins Pléiades 1A in orbit; and when Pléiades 1B and SPOT 7 launch in the coming months, it will form a coherent and smart optical constellation providing images distributed by Astrium Services.
- With this new constellation, Astrium Services, will offer unique applications in an unrivalled delivery time.
September 9, 2012–Built by Astrium, Europe’s leading space technology company, the SPOT 6 Earth observation satellite was successfully launched by a PSLV launcher from the Satish Dhawan Space Center in India. It joins Pléiades 1A in orbit, a recently launched high resolution Earth observation satellite with products distributed by Astrium Services. These satellites will form a complete constellation with Pléiades 1B and SPOT 7 in 2014–the next satellites on the launch track for Astrium Services.
As soon as they are validated in orbit, SPOT 6 and SPOT 7 will be operated by Astrium Satellites and coordinated with the two Pléiades satellites along the same orbit. This constellation will offer unique applications, delivering products in an unrivalled delivery time to Astrium Services’ customers. Each point of the globe will be seen each day once in medium resolution and in high resolution. Moreover, while SPOT 6 & 7 provide a wide area views, Pléiades offers, for the same zone, products with a narrower field of view but with an increased level of detail at 50 centimeters.
“With four satellites phased 90 degrees apart in the same heliosynchronous quasi-polar orbit, we will be able to offer our customers geo-information products in record time, in as little as six hours,” said Eric Beranger, CEO Astrium Services. “With four satellites, we obviously have more freedom in terms of the revisit interval, for better change detection or faster coverage. Users can choose between high-resolution data capture at a specific point and medium-resolution data capture over a larger area. We can also combine the two, of course. For instance, in case of flooding, SPOT 6 can provide the big picture and Pléiades will bring the focus over the most populated or damaged areas.”
Geo-information services play a vital role in converting the latest geospatial information (such as medium and high resolution satellite imagery) into reliable and usable economic data. SPOT 6 is just one of the remote-sensing satellites that now enables Astrium Services to offer the widest range of Earth observation products and value-added services in response to the needs of its customers; particularly in the areas of national and defense mapping, agriculture, deforestation and environment monitoring, maritime and coastal surveillance, mining, civil engineering and oil and gas.
SPOT 6 is an Earth observation satellite offering optical medium-resolution capabilities. Like its twin SPOT 7, which is slated to launch early 2014, SPOT 6 has a 60-km swath and provides imagery products with a resolution down to 1.5-meters. SPOT 6 and SPOT 7 will ensure service continuity of the SPOT 4 and SPOT 5 satellites, which have been operating since 1998 and 2002 respectively. Moreover, both ground and space segments are designed for improved performance compared to the previous SPOT missions, especially in terms of reactivity, satellite tasking, product delivery and collection capacity. The SPOT 6 and SPOT 7 constellation will provide daily revisits to everywhere on Earth with a total collection capacity of 6 million km² per day.
SPOT 6 and 7 have an estimated service life of 10 years. For more information about SPOT 6 and 7 and/or the Pléiades constellation, please contact the Apollo Mapping sales team at sales@apollomapping.com or (303) 993-3863.
Scientists at the Department of Family and Social Medicine at the Montefiore Medical Center in New York composed a study using public participation GIS (PPGIS) to build maps of social determinants of diabetes and obesity in the Bronx, New York. The researchers chose Google Earth to build community maps based on the ease of use, as well as the fact that the software is free. The foundation of the paper was written around two case studies using Google Earth. The first involved medical treatment recipients mapping their sources of food and exercise in their neighborhood; and the second involved medical students mapping healthy food choices accessible near their student-run free clinic.
An area of approximately one square mile (20 city blocks) by the old Yankee Stadium was examined near the Montefiore center, and lists of places to obtain food and exercise were documented. There were 11 sites for exercise recorded (predominately playgrounds) and 113 sources of food. Forty-four of these food establishments were bodegas, and thirty-two were fast-food restaurants.
The Albert Einstein College of Medicine also runs a free clinic on Saturdays that is staffed by 3rd and 4th year medical students. It has been in operation since 1999, and at the time of the publishing of this study (2008; from unpublished data in 2005), the Saturday clinic had seen over 5,000 patients. A survey done by the center showed that the most important factors stated by patients to improve their healthy were to consume healthier food and to get more exercise.
A second area of study was documented near the Saturday clinic and it involved a ten-block radius (slightly larger than one square mile). There were 168 food sources identified that were then broken into four categories: three for smaller corner stores and one for larger supermarkets. The smaller categories were labeled “poor variety” (n=81), “some variety” (n=57), and “good variety” (n=19). The fourth category was well-stocked supermarkets, eleven of which offered healthy options not available in any corner store. The study found that residents typically had to walk by 1 or 2 corner stores with lesser quality food merchandise before finding one that had healthier options. The study also revealed that there was a large amount of fresh produce available in an area that would be considered a lower-socioeconomic zone. This information shows that with some effort, residents can obtain healthier food options.
Google Earth was used to construct maps with icons that list the best and worst options for healthy food and exercise relative to where the residents reside. The researchers felt that maps give visual representations to healthy options far better than a printed word document could. When people are able to see exactly where their best options are in relation to where they live or work, they can better plan their routes or times for food shopping or dining.
While the researchers did not expect individual citizens (especially in poorer areas) to build these maps on their own, they did feel that it was a service that should be available to everyone. Providing better food and exercise options will lead to healthier, happier people; and therefore reduce health care costs for the community in general. And by making these maps available to the public, they could drive the food sources in the Bronx area that provide lesser quality foods into offering healthier options. Given its popularity and ease-of-use, Google Earth is an ideal platform for maps that could improve the lives of community residents such as these.
Justin Harmon
Staff Writer
Traveling from Madrid, Spain to the next sister city on the list we arrive in Havana, Cuba. An obvious link here would be the shared language–Spanish–though English is also spoken throughout the island nation as well. Residents of Havana are referred to as Habaneros (yes, like the pepper which originated in the Amazons), and Havana is the Caribbean’s largest city at around 2.1 million residents.
The United States has a longstanding relationship with Cuba, though it chilled in the late 1950s and early 1960s–perhaps a little background is due here. Steam power arrived in Cuba around 1820 and by ~1840, there were six vessels operating on both coasts of the island to transport its commodities. The railroads came in the 1830s, and by 1850 the telegraph had been introduced. American machinery was the driving force for ‘development’ in Cuba, so Americans started to settle on the island during the 4-5 months of the sugar harvest and then returned home for the remainder of the year. Soon the American settlers got into the business of buying local sugar and coffee plantations as well as cattle ranches and tobacco farms. By 1860, there were 2,500 Americans living on the island-nation full time. The panic of 1893, which was fueled by an economic depression in the United States, sent many more Americans to Cuba because of the extremely low-cost of land; and by 1905, there were nearly 13,000 U.S. citizens living on the island.
Another significant incident that connects the United States and Cuba is that of the Cuban Revolution which started in July of 1953 and culminated January of 1959, led by Fidel Castro. Once the Batista regime had been overthrown by Castro and his allies, U.S. President Eisenhower recognized the newly formed government, but relations started to cool soon after. Agrarian reforms and nationalization of industry were the first signs of a strained relationship; and as state action began to consume private businesses, the U.S. stopped buying sugar (hello, corn syrup) and stopped providing oil. The Bay of Pigs invasion further isolated the two countries leader’s chances of compromise. The recent transition of power from Fidel to Raul Castro has led to some governmental philosophy changes, and perhaps the two countries are on the path to reconciliation; but only time will tell.
Havana was founded by the Spanish in the 16th Century as a shipping port and it served as the conduit for products from the New World to Spain. The British took Havana in the Seven Year’s War in 1762, though as part of a treaty, Spain regained control of Cuba in exchange for present-day Florida. In 1898, the Treaty of Paris ended the Spanish-American War and resulted in Spain turning over control of the island-nation to the United States. And in 1902, Cuba was granted formal independence.
Havana lies on the northern coast of Cuba to the south of the Florida Keys. It enjoys a beautiful, year-round tropical climate that is ripe for tourism. In 2010, the city welcomed 1.2-million visitors, up nearly 20% from just five years before. Old Havana is known for its amalgam of western architecture, and a stroll through it will show you the influences of many of the world’s Western countries. Havana is also home to an abundant population of classic American cars from the 1950s and 60s. Referred to as ‘yank tanks’ or ‘maquinas,’ roughly 60,000 of these nostalgic beauties still patrol the roads of the city and island. In 1962, the US instituted a trade embargo and Cubans could no longer receive replacement parts for the cars. So the work ethic and ingenuity of Habaneros came into play as they had to become resourceful and manufacture their own parts, adapt them from other machines or cars and come up with unique solutions to keep the cars rolling. Due to government wage caps, Habaneros typically work multiple jobs to make ends meet. Cutting hair in the street, filling spent lighters and selling old clothes door-to-door are just some of the ways they can earn extra money.
Havana is a place of nostalgia, beauty, diversity and rich culture. With numerous festivals, performing and visual arts, it is a city that will keep you occupied and interested for quite some time. Its architecture alone would be enough to keep any aspiring photographer busy for an entire vacation!
Justin Harmon
Staff Writer