Displaying Elevation Rasters in Free Software


While our target audience for the Digital Coast is the management community, the data resources we develop are certainly valuable to a lot of other folks out there. However, the average person probably doesn’t have the pricey software package needed to handle geospatial data. That usually leads to complaints about Tiff images of the elevation appearing black and white after someone tries to open them in the default Windows application. If that sounds familiar, this is the post for you. We’re going to pull down some real elevation data, display it in a free open source GIS package, and make it look nice and clear. If you want to follow along, start by downloading and installing QGIS. It’s not the only option out there, but it’s a pretty good multi-platform one and will serve our purposes.

I’m starting with a file I downloaded from the Digital Coast Data Access Viewer that covers Sunset Beach, Hawaii. We’re going to look at the bathymetry in this surfing area, so the data set is the 2013 USACE NCMP Topobathy Lidar: Oahu (HI). I entered “Sunset Beach, HI” in the search box and accepted the default box, but the link on the data set name should take you there as well. I also used the default options in the download resulting in a 32-bit floating point Tiff file. There is a previous post with tips on using the DAV. I opened QGIS and did a drag and drop of the Tiff file into the main window. The result looks like this:

The initial view after loading a floating point tiff in QGIS is shown. The image is a greyscale of the elevation along the coast of Oahu.
Initial view after loading a floating point tiff in QGIS.

Not very pretty at this point. Just a greyscale rendering across the range of floating point values. By the way, it’s the fact that it’s floating point and not integers that confuses the default Windows programs. This file has the real elevations in decimal feet as the values for each cell, not colors. To change how it is displayed, right click on the image’s name in the lower left and select properties. The options we need can be found by clicking Style on the left side to get a dialog that looks like this:

The layer properties dialog box is shown.
Layer properties dialog box after selecting Style.

Here you’ll see that under band rendering the render type is singleband gray. We need to change that to singleband pseudocolor, so select that from the drop-down render type menu and you’ll see some changes to the dialog. We’re going to go with the spectral palette that comes up, but click the invert box so blue is low instead of high. Also, we want to highlight the bathymetry so we’ll set the max value to zero. Click the classify button and the dialog should now look something like this:

The layer properties dialog box is shown after setting singleband psuedocolor, adjusting the range, and clicking the classify button. It now includes a legend showing the elevation range for each color.
Layer properties dialog box after setting singleband psuedocolor, adjusting the range, and clicking the classify button.

Click OK and you’ll be back in the main window and it should look like this now:

An image of our topobathy data using the psuedocolor map. This is a rainbow palette with blue for the deeper areas and red for shallow areas. Everything above water is red.
Our topobathy data shown with the psuedocolor map.

While that looks fine, it could sure use some background for context in the form of a basemap. There are several ways we could do this, including downloading some imagery to put underneath our elevation. For this instance, we’re going to make use of one of the QGIS plugins and then use a map service.

From the plugins menu at the top, choose manage and install plug-ins. You’ll get a dialog box like the one below:

The plugins dialog box is shown with the OpenLayers Plugin highlighted.
Dialog box for plugins.

Select the OpenLayers Plugin and install it. Once you’ve done that, you can choose the OpenLayers plugin under the web menu. I found it easiest to first select the OpenLayers Overview, which added a new widget at the bottom of the left side. From there I could pick which basemap I wanted and add it to the map using the little icon with a green plus to the right of the service name (make sure you check the enable map box.) Once you do all that, your map should look something like this image using the Bing Aerial with Labels service:

The topobathy data is shown on top of aerial imagery from a web service.
The topobathy data is shown on top of aerial imagery from a web service.

Note that if the imagery just covered up your elevation, drag the elevation name so it is above the imagery name in the layers panel on the left. That doesn’t look bad, but it sure has a lot of red and since I’m really just interested in the bathymetry, it’s covering up part of the basemap that would help me orient at the shoreline. This is because I effectively made everything above zero feet red in the color map. We’ll go back in and clean that up a bit.

Right click on the elevation on the Layers Panel again and select properties just as you did before. Under the style section, we’re going to add a new range to our color map using the green plus sign (circled in the image below.)

The layer properties dialog is shown after adding a new color and range using the green "plus" button (circled in red) and setting the color to transparent.
Layer properties dialog after adding a new color and range using the green “plus” button (circled in red) and setting the color to transparent.

Edit the values so the range is 0 to 350, which was our max value for the data set. Double-click color for your new range and you’ll get the change color dialog box. We don’t really care what the color is (even the horrible pinkish color I have is fine) because we’re going to make it transparent. Make the opacity zero percent and hit OK.

Change color dialog box with the opacity control circled.
Change color dialog box with the opacity control circled.

Now you should have something that looks like the image below. It’s not perfect for a number of reasons, such as the zero value for my elevation may not match the tide stage for the imagery and there are areas where the lidar data couldn’t get through the surf zone. But it should give you a good starting point to play with the data and make what you want.

Bathy data shown with a psuedocolor map on top of aerial imagery where the topographic data has been turned transparent.
Bathy data shown with a psuedocolor map on top of aerial imagery where the topographic data has been turned transparent.

There’s really a lot of detail in the data that you can’t see while looking at the whole data set. If I zoom into the area around Sunset Beach, you can see a lot more of the detail that’s there. I’ll leave it to a real surfer to interpret what’s going on there.

A zoomed in view around Sunset Beach, HI showing significant variability in the bathymetry. It appears there is a deep trench north of Sunset Beach that may be influencing the surfing conditions.
Zoomed in view around Sunset Beach, HI showing significant variability in the bathymetry.

5 comments

  1. But how to stretch the color scale according to current display extent? Which is a basic function in ArcGIS, but not available in QGIS.?

    Like

    • That ability may not be in QGIS currently, at least not automatically. If you need it, you should certainly choose the program that does it, just as with anything else. Both ArcGIS and QGIS are good programs with different strengths and weaknesses.

      Like

    • Not sure if I properly understand the question, but customizing the output image/render color scale, as regards the number of colors, particular values of any chosen colors, and selection of custom elevation ranges for display of any given color are in fact doable in QGIS.

      If any of the above relates to what you’re asking about, I will be very happy to be able to share such limited grasp of things as I have been able to learn, to date.

      I will check back periodically, to see if you have further questions or comments regarding any of this.

      Like

Leave a Reply. Comments are moderated.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s