Splat! – Digital Elevation Data with QGIS

Introduction

Splat! (Ref.1) is a very versatile propagation prediction program that I discussed in several previous posts. In my first post, I looked at installation on Windows and Linux, how to obtain the digital elevation data files, create QTH & LRP files, and run a simple point to point analysis (Ref.2). In the second and third posts I examined Marine VHF communications calculations for AIS & VHF coverage (Ref.3/4). In this post I will consider how we can use QGIS, an open source Geographic Information System, to analyze and convert various digital elevation data files so that they can be used with Splat! (Ref.5). Splat requires SRTM 1arc_sec (30m) or 3arc_sec (90m) data files of type .hgt which can then be converted to .sdf splat data files.

Canadian CDEM GeoTiff .tif vs. SRTM .hgt

Fig.1 Canadian CDEM File Grid Near Toronto
Fig.2 GeoTIFF cdem_031D.tif Data PDF
Fig.3 GeoTIFF cdem_031D.tif on OpenStreetMap
Fig.4 SRTM N44W080.hgt on OpenStreetMap
Fig.5 gdalinfo cdem_031D.tif
Fig.6 gdal info N44W080.hgt
ParameterGeoTIFF .tif File
cdem_dem_031D.tif
SRTM .hgt File
N44W080.hgt
GEOGCRS
GeoCordSys
NAD83(CSRS)WGS84
AreaLat: 44deg – 45degN
Long: 78deg – 80degW
Lat: 44deg -45degN
Long: 79deg-80degW
Pixel0.000208333333333deg
0.75arc_sec
+/- 23.2m
0.000277777777778deg
1arc_sec
+/- 30.9m
File Size9601,4801
92,227,633bytes
3601,3601
25,934,402bytes
Band1Block 9601×1
Int16
NoData=-32767
Min=114.0
Max=481.0
Mean=261.624
StnD=48.170
Block 3601×1
Int16
NoData=-32768
Min=171.0
Max=410.0
Mean=243.75
StndD=38.544
Fig. 7 Main Differences GeoTIFF & HGT Files

Let’s say we want to use Canadian CDEM files with Splat (Ref.6). Figure 1 shows the CDEM grid around the Toronto area. Figure 2 shows the CDEM data pdf for file cdem_031D.tif. Figure 3 shows this file in grey scale overlayed on Open Street Map as viewed in QGIS. Figure 4 shows the SRTM file N44080.hgt overlayed on Open Street Map as viewed in QGIS. Note that 031D covers 2deg of Longitude whereas the N44W080 covers only 1deg. Figures 5 & 6 show the gdalinfo command output for each file. Figure 7 highlights the critical differences in each file, which basically are the reference model, sampling size, file size and boundaries.

In order to do the conversion, we need a two step process. First step is to use gdalwarp to change the reference projection, sampling size and boundaries. The second step is to use gdal_translate to convert from .tif to .hgt file type. GDAL “Geospatial Data Abstraction Layer” is a tool that is embedded in QGIS (Ref.7).

QGIS & GDALWARP

Fig. 8 QGIS Workspace Showing cdem_031D.tif & Diagonal Profile
Fig.9 QGIS gdalwarp Menu
Fig.10 QGIS 031Dresamp

In order to familiarize myself with QGIS, I found References 8 & 9 very helpful. The first step is to open cdem_031D.tif in QGIS and use gdalwarp to change the reference model, resample and crop. Figure 8 shows cdem_031D.tif with an arbitrary terrain profile line that we can use to check between the conversions. Figure 9 shows the gdalwarp menu with source cdem_031D.tif EPSG:4216 and target EPSG:4326. The output file resolution is resampled to 0.000277777777778deg and cropped to the boundaries of N44W080. The file is saved as 031Dresamp.tif. Based on Reference 10, I changed the resampling rule from “nearest neighbour” to “lanczos”. Figure 10 shows the resampled file.

QGIS & GDAL_TRANSLATE

Fig.11 QGIS gdal_translate Menu
Fig.12 Profile Comparisons
Fig.13 Profile Comparison Elevation Spreadsheet
Fig.14 Raster Subtraction N44W080.hgt – N44W080.hgt_converted
Fig.15 Diagonal Profile N44W080conv vs. Google Earth

Now the last step is to take the resampled 031Dresamp.tif and convert this to an SRTM .hgt file. Figure 11 shows the gdal_translate Menu used to do this. You have to give the correct SRTM name in this case N44W080.hgt. Figure 12 shows the same profile as seen in the original .tif file, the resampled .tif, the real .hgt and the converted .hgt. Figure 13 is a spread sheet showing elevation values along the profile in meters vs distance in arc_deg along the profile line. Figure 14 shows the raster subtraction of the real .hgt file with the converted .hgt file.

Conclusion

So how good is the conversion? You can see from the spreadsheet there are differences between cdem_031D.tif and N44W080.hgt to start off with. So after resampling, re-projection and cropping there are differences. The max difference over the path of 1.322arc_deg (147Km) between N44W080.ght and the N44W080conv.hgt is 12m, but only in several places, 9m of which is due to the original difference between cdem_031D.ti and N44W080.hgt. Typically the difference is about 2m. I am not a Geospatial expert, but this process seems to work. In the first step you do need to create a cropping mask so you have to know the exact SRTM coordinates. Finally Figure 15 shows the profile across the diagonal of the file compared to Google Earth showing a close match.

Fig.16 YouTube Video Splat! – Digital Elevation Data with QGIS

Please send your comments, questions and suggestions to:
contact:

YouTube Channel
YouTube Channel

References

#1. – Splat Home Page
http://www.qsl.net/kd2bd/splat.html

#2. – “Splat! RF Signal Propagation, Loss and Terrain Analysis Tool”
https://jeremyclark.ca/wp/telecom/splat-rf-signal-propagation-loss-and-terrain-analysis-tool/

#3. – “Splat!_RF Signal Propagation Calculations_2”
https://jeremyclark.ca/wp/telecom/rf-signal-propagation-calculations_splat/

#4. – “Splat! – Marine VHF Propagation”
https://jeremyclark.ca/wp/telecom/splat-marine-vhf-propagation/

#5. – “QGIS A Free and Open Source Geographic Information Systems”
https://www.qgis.org/en/site/

#6. – “Canadian CDEM 1945-2011”
https://open.canada.ca/data/dataset/7f245e4d-76c2-4caa-951a-45d1d2051333

#7. – “GDAL Geospatial Data Abstraction Layer”
https://gdal.org/

#8. – “QGIS A Complete Beginners Guide”
https://www.amazon.ca/dp/B0BLYGQF3K/

#9. – “Gentle Introduction to GDAL Part 1/2”
https://medium.com/planet-stories/a-gentle-introduction-to-gdal-part-1-a3253eb96082

By Jeremy Clark

Jeremy Clark is a Senior Telecommunications Engineer and Advanced Amateur Radio Operator VE3PKC. He is the author of E-Books on Telecommunications, Navigation & Electronics.