For a while now I’ve been enjoying the ability to export ham radio logging data from Ham Radio Deluxe Logbook direct to Google Earth for visualisation of my contacts. However now that I have some far reaching contacts, Google Earth no longer presents a full view of radio coverage.
What I’d like to do now is be able to plot the same data onto a Great Circle projection map, centered on my home location to present a view of radio contacts’ direction and distance. Amongst other things, this presents a view of my contacts that can be easily related to antenna configuration and directionality. A friend (with a specialism in Geographical Information Systems, GIS) has pointed me at the open source QGIS software. Some light reading around the subject suggests that I basically have two tasks to perform:
- Import the data as a Vector Layer into QGIS;
- Change the project’s Coordinate Reference System (CRS) to a great circle type projection, centred on my location.
Free world map data is available here: http://www.naturalearthdata.com/ …download suitable files and import appropriate shapefiles (.shp) as new vector layers.
Below are my notes on how I perform the various steps in creating maps. Jeff N1YWB got in touch using the comments below and has taken this much further to produce a great tutorial on his blog and some automated tools for QGIS to produce some of the map elements. This information below is probably still of use but if you’re interested in this you should definitely check out Jeff’s page.
Importing Data from Ham Radio Deluxe to QGIS
Export selected contacts from HRD Logbook to Google Earth (right-click, “Lookup…”) opens an exported KML file in Google Earth and the contact data appears in Google Earth’s “Temporary Places” folder. The unmodified KML file doesn’t appear to import correctly into QGIS (the folder structure that is generated by HRD Logbook’s export seems to mask the contents) but the individual points and lines can be moved to a single new folder in Google Earth (without their individual folders) and this will save as a KML file that does import nicely into QGIS:
A slightly hacky way of making the HRD0Logbook output KML file readable by QGIS is to use a text-based ‘find and delete lines’ routine to remove the folder structure which seems to be the problem.
Notepad++ is a good tool for this kind of work. Open up the KML file and go Search, Find… open the Mark tab and check the Bookmark line box. Now do a Mark All for the terms “folder” and “All”. This will bookmark the lines that are to be removed. Now back the the menu bar, Search, Bookmark -> Remove Bookmarked Lines. Now save the modified KML file and this should import nicely into QGIS:
So now I can get all of my contacts data input to QGIS from HRD Logbook without too much fuss…
Importing data from other logbook software: ADIF to KML conversion
Since writing this page I have moved over to Linux pretty much full-time and I now use CQRLog as my logging software. CQRLog doesn’t have an ‘export to KML’ option at this time so the method I now use is to export my contact data as an ADIF file and then use an ADIF-to-KML conversion tool to generate the file for import to QGIS.
A quick internet search for “ADIF to KML” will reveal a few different tools for generating the KML file from your ADIF file. My best method so far is to use K2DSL’s online tool to generate a KML file (unfortunately each contact is two layers so runs into thousands of layers and QGIS chokes on importing this file) and then run it through the gpsprune application to reduce the number of layers down to two (one for points and one for lines).
Creating a Great Circle (Azimuthal Equidistant) Map
Importing a basemap shapefile or two from Natural Earth is pretty easy and gets you a world map in the standard WGS84 projection (here I have a coastline layer and a 10° graticule layer):
The next thing to do is to change the Coordinate Reference System (CRS) from WGS84 (the “normal” but distorted view we’ve come to expect from world maps) to a great circle projection, centered on my location (approximately 51°N 1°W). My initial mistake here was to search with the terms “great circle QGIS” and this brought me lots of information about plotting great circle route lines but not maps. I realised “great circle” is a fairly ambiguous phrase which is used in varying ways in the GIS community. Changing the search terms to a more precise “azimuthal equidistant QGIS” quickly yielded guidance on the projection I was looking for.
In QGIS go Settings, Custom CRS… and create a new user defined CRS using the following parameters:
+proj=aeqd +R=6371000 +lat_0=51 +lon_0=-1
…where my location is 51°N 1°W, enter your lat/long figures accordingly.
Now go to File, Project Properties, CRS tab and select the custom CRS that you’ve just defined. This gives me the result I’m after:
Right, next thing I need is radials and range circles…
I’m sure there’s an easier way to do this directly in QGIS with buffers but here’s one simple method (and probably easier to understand for a GIS n00b like me). This online tool creates KML files of circles of a given radius and centre. They don’t seem to import straight into QGIS as vector layers but they do open in Google Earth and that allows me to group them into a Places folders and export as a KML file that imports as vector layers (a bit laborious but only needs to be done once for any given location):
Different styles can be applied to the map features based on their properties. My first use of this is to colour the points on the map according to the frequency band used for the contact.
The data is exported from HRD with a Name and Description field against each data point. A sample Description is as follows:
"Time=03/11/2013 14:40:37, Band=12m, Mode=RTTY"
So let’s identify the “Band=xxxx” portion of each point’s description and assigning a unique style accordingly… In QGIS, open up the Layer Properties, select Style on the left and look for the drop-down box that gives you “Rule-based” and select this. Now add a rule for each band. In the Rule Properties dialogue, an example of one of my filters is:
but the two screen captures below probably explain it better than words:
…and voila! We now have different styles according to the frequency band of the contact.
QGIS offers the Print Composer as a means of customising the GIS output into visual maps and this is an easy way to add a legend to the map. I’ve also truncated the map contents to a circle that fits within a compass outline graphic (drawn using Inkscape).
This black circle (left) is added in to Print Composer as an image directly over a square map area and the Blending Mode (under Item Properties, Rendering…) set to “Lighten”.
This compass outline (right) is then added in as another image over the same square area and the Blending Mode for this layer is set to “Multiply”.
There’s still a lot of tidying up to be done here (in terms of colours and styles) but the basics of producing radio contact maps are pretty much coming together. If anyone reading this has any suggestions on improvements, please feel free to comment below!
4 thoughts on “GIS for Radio Maps”
I’m also working on making equidistant azimuthal maps with qgis. I’ve gotten about as far as you. One thing I discovered that was a bit unintuitive was that I had to ‘densify’ my grid to add more points, otherwise the lines in the grid would not project correctly. Have you had any luck adding a degree reticle circle around the outside border of the map? Or adding azimuth lines radiating out from the center?
Good call overlaying the compass bitmap. It’s pretty much static for this kind of map anyway so there wouldn’t be much benefit to having it in a GIS layer, except perhaps resolution independence. Maybe that’s even possible in the composer by overlaying a vector format graphic, e.g. something in postscript or svg.
I figured out how to do the range circles in qgis. First you need to create a new points layer and add a point for your QTH. It should be at coordinate 0,0. I used the NumericDigitize plugin to be able to specify the coordinates precisely. Next go to menu Vector->Geoprocessing->Buffer. Select the QTH point layer you created. I set segments to 25; the number needs to be large enough to approximate a circle at your output resolution. Buffer distance should be in meters so 5,000km = 5,000,000 meters. Specify an output shapefile named “range1” or something. Set the CRS your custom equidistant azimuthal CRS. You should now see an opaque circle. Don’t close the buffer dialog yet, go ahead and buffer the buffer layer you just created to create the next ring, and so on. Finally once you’ve created all the rings, edit their properties, set the style of fill to No Brush. This could probably be trivially scripted.
Nice, thanks Jeff! Yes, the graphics I’ve imported into Print Composer were drawn as .svg and import in that format but I’ve uploaded .png here on this page because WordPress won’t display that format. I should upload the .svg files here when I’ve got a minute.
Thanks for sharing the buffers method, that’s much more elegant than my clunky KML drawn from an external website, after all, who knows if it will be there next time?
Great work, 73!