SRTM Data – Take 2

Although my previous attempts [1, 2] at transforming the Space Shuttle SRTM data into a 3D landscape model worked fine the whole process was a little cumbersome. I decided to have another shot with a couple of improvements in mind:

  1. The version of SAGA GIS that is available from the Ubuntu repositories is several years out of date. It would be useful to bring this up to the latest version, or find an alternative if this wasn’t possible.
  2. I really wanted a better way of loading map images from Open Street Map or one of its derivatives. OpenTopoMap in particular would work well for landscape models.

As a subject I picked the area around Ramsau / Schladming in Austria as I knew that would give some dramatic scenery. The final result is below and this actually uses a Google Maps hybrid overlay. Details of the process can be found further down the page.

Elevation data courtesy of the U.S. Geological Survey / Map data © 2019 Google

Geographic Information System ( GIS )

SAGA GIS ( Part 1 )

The version of SAGA GIS that’s available from the Ubuntu repositories is 2.3.1. According to the SAGA GIS repository on SourceForge this dates from 2016 with the latest version being 7.2. I had hoped that there would be a Personal Package Archive available somewhere but the only one that I found was still a few versions out of date.

The alternative would be to build from source but I didn’t want to go down that route just yet …

QGIS

Another popular open source GIS for Linux is QGIS. It seems to have a popular following and there are plenty of tutorials and help available. My original reason for picking SAGA GIS was that it had the best tool for fixing holes in the input but as this wasn’t needed with the SRTM data then maybe it was time to give QGIS a try.

Installation was straightforward with detailed instructions available for Ubuntu systems. Its general operation was also easy and I quickly imported the previous set of SRTM and Landsat data. But when I tried to export the 3D data in the Esri grid format that the original LiDAR data used ( and that my processing tools expect ) then I hit some problems:

Firstly for some reason QGIS decided that the data didn’t have square pixels and so the GDAL utility that it uses to create the Esri grid file creates a slightly different output which I think is not part of the standard and certainly breaks my software. The reason, and possible fix, can be found in the GDAL documentation:

From https://www.gdal.org/frmt_various.html#AAIGrid

If pixels being written are not square (the width and height of a pixel in georeferenced units differ) then DX and DY parameters will be output instead of CELLSIZE. Such files can be used in Golden Surfer, but not most other ascii grid reading programs. For force the X pixel size to be used as CELLSIZE use the FORCE_CELLSIZE=YES creation option or resample the input to have square pixels.

Unfortunately the QGIS dialog for this tool doesn’t have an option to set the FORCE_CELLSIZE flag. Even worse although earlier versions of QGIS allowed the user to manually edit the GDAL command this option has been removed from version 3 and is not likely to be reinstated. 😦

It was possible to cut & paste the command to a terminal window, make the necessary edits and create an output grid in the correct format. However the final 3D model seemed to have a very strange shape. Before going down that particular rabbit hole I decided to give SAGA GIS another go …

SAGA GIS ( Part 2 )

I’m normally wary of building from source any programs that have a large graphical component. However the instructions on SourceForge seemed to be straightforward and I found a blog post that confirmed this so I downloaded the source and set it going.

To my slight amazement it worked perfectly first time 🙂 At this point I was a bit annoyed at spending all that time on QGIS but I now have the latest version of SAGA GIS up and running.

Map Overlay

I felt sure that there was an easier way of importing map overlays and after a bit of searching online I came across the documentation for Module Import Open Street Map Image which seemed to do exactly what I wanted. It’s pretty buried in the menu options and not labelled that clearly so you’re not going to stumble on it by accident and I couldn’t find any reference to it the documentation.

For the record it’s under “Tools > Import/Export > GDAL/OGR > Import TMS Image” and the dialog ( left ) gives a number of enticing options including Google Maps.

The “user defined” option is also quite useful, especially for maps derived from Open Street Map. There’s a list of these available and most of them use a similar server URL format to Open Street Map. OpenTopoMap tiles can certainly be downloaded using the same format URL but from a different server.

One point to note is that there may be varying licencing and usage restriction on downloading from these different servers. While the Open Street Map data is a Creative Commons licence there are restrictions on downloading that data. Google has slightly different licencing conditions.

For the Ramsau model I chose the Google Hybrid overlay as it showed roads and ski tracks as well as the satellite imagery. The vertical scale has been exaggerated by 2x otherwise everything else is unchanged.

Further Work

Overall these investigations have given me some very worthwhile process improvements for creating 3D landscape models. The only thing that’s remaining is that I’m not 100% sure that the downloaded maps are at the correct zoom factor. I think that it should be possible to get better resolution overlays, the map servers certainly allow the zoom level to be entered as part of the tile download URL. However I haven’t yet found how to set this parameter in SAGA GIS.

2 thoughts on “SRTM Data – Take 2

  1. Dave

    This article takes me back 30 to 40 years when I was struggling just to learn ArcInfo, and someone from the MIT Media Lab wrote and asked if I had played with Linux yet.
    A lot of water has certainly flowed under the bridge since then.

    Your writing is clear and has a nice logical progression. Well, you were an engineer after all. I plan to follow up your instructions and try it all out, as I remain keen on mapping, and so much data is now available.

    So thanks for taking your time to share your experiences!

    Liked by 1 person

    Reply
    1. theretiredengineer Post author

      Thank you for your kind words. The amount of public domain geographical data that is available these days is staggering, as well as the open source GIS tools to process that information. There’s even data available for the moon which could make an interesting 3D print project one of these days.

      Like

      Reply

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.