Category Archives: Uncategorized

TAFL — as a proper geodatabase

Update, 2017: TAFL now seems to be completely dead, and Spectrum Management System has replaced it. None of the records appear to be open data, and the search environment seems — if this is actually possible — slower and less feature-filled than in 2013.

Update, 2013-08-13: Looks like most of the summary pages for these data sets have been pulled from; they’re 404ing. The data, current at the beginning of this month, can still be found at these URLs:

I build wind farms. You knew that, right? One of the things you have to take into account in planning a wind farm is existing radio infrastructure: cell towers, microwave links, the (now-increasingly-rare) terrestrial television reception.

I’ve previously written on how to make the oddly blobby shape files to avoid microwave links.  But finding the locations of radio transmitters in Canada is tricky, despite there being two ways of doing it:

  1. Wrestle with the Spectrum Direct website, which can’t handle the large search radii needed for comprehensive wind farm design. At best, it spits out weird fixed-width text data, which takes some effort to parse.
  2. Download the Technical and Administrative Frequency Lists (TAFL; see update above for URLs), and try to parse those (layout, fields). Unless you’re really patient, or have mad OpenRefine skillz, this is going to be unrewarding, as the files occasionally drop format bombs like
    never do this, okay?
    Yes, you just saw conditional different fixed-width fields in a fixed-width text file. In my best Malcolm Tucker (caution, swearies) voice I exhort you to never do this.

So searching for links is far from obvious, and it’s not like wireless operators do anything conventional like register their links on the title of the properties they cross … so these databases are it, and we must work with them.

The good things is that TAFL is now Open Data, defined by a reasonable Open Government Licence, and available on the website. Unfortunately, the official Industry Canada tool to process and query these files, is a little, uh, behind the times:tafl2dbfYes, it’s an MS-DOS exe. It spits out DBase III Files. It won’t run on Windows 7 or 8. It will run on DOSBox, but it’s rather slow, and fails on bigger files.

That’s why I wrote taflmunge. It currently does one thing properly, and another kinda-sorta:

  1. For all TAFL records fed to it, generates a SpatiaLite database containing these points and all their data; certainly all the fields that the old EXE produced. This process seems to work for all the data I’ve fed to it.
  2. Tries to calculate point-to-point links for microwave communications. This it does less well, but I can see where the SQL is going wrong, and will fix it soon.

taflmunge runs anywhere SpatiaLite does. I’ve tested it on Linux and Windows 7. It’s just a SQL script, so no additional glue language required. The database can be queried on anything that supports SQLite, but for real spatial cleverness, needs SpatiaLite loaded. Full instructions are in the taflmunge /

TAFL is clearly maintained by licensees, as the data can be a bit “vernacular”. Take, for example, a tower near me:


The tower is near the top of the image, but the database entries are spread out by several hundred meters. It’s the best we’ve got to work with.

Ultimately, I’d like to keep this maintained (the Open Data TAFL files are updated monthly), and host it in a nice WebGIS that would allow querying by location, frequency, call sign, operator, … But that’s for later. For now, I’ll stick with refining it locally, and I hope that someone will find it useful.

The Invisible City

Now you see it …

There’s not a whole lot north of North Bay. Highway 11 winds through some extensive geometry, but few habitations. Until something wonderful (and quite a bit wrong) happened at 46° 31′ 21″ N, 79° 33′ 9″ W on OpenStreetMap. A whole new town about 25 minutes out of North Bay sprung up overnight — and was as quickly deleted as mappers caught and reverted the vandalism.

Now you don’t.

The misguided mapper put quite a lot of work into this ephemeral town. It’s got urban rail, parklands, residential areas and more. You can see the detail on this large image of the town (650 KB PNG). If you want to play with the data, here’s a zipped OSM XML file of the area before it was reverted. But please, don’t re-upload it; OpenStreetMap should be for real features on the ground, and not for confusing map data consumers.

Thanks to Bootprint for noticing this, and to rw__ for reverting the edits.

Mephisto’s Oriental Mystery — solved!

I bought a pair of Mephisto shoes today, and to go with their wayfaring imagery, the insoles are decked out with map-like symbols. Prominent is a map coordinate: N 38° 51.343′ E 94° 47.963′.

If you look at a map there, it’s a fairly empty mountainous place near the border of Qinghai and Gansu. It’s definitely not where the shoes are made, unless Mephisto have a stealth factory there.

There was something familiar about the coordinate, through. I thought I’d try flipping it to the western hemisphere:

It’s the Garmin headquarters in Olathe, KS! Every Garmin GPS I’ve ever owned has had the HQ as a default waypoint. I’m guessing a designer at Mephisto was looking to add something legitimately mappy to the graphics, and picked up their satnav to pull out a coordinate. Guessing that Olathe isn’t a very mysterious, rugged destination, they flipped the hemisphere to give it more eastern promise.

Updating maps … to outdated data

I caved, and bought a Garmin nüvi 1490. Not that my GPSMap 60CSx wasn’t great at routing, but remembering to update maps before travel and its fiddly mounting requirements were a pain.

So, two hours of downloading map updates, and I fire it up … to find that the three year old hotel in Dartmouth, NS we were staying in was in the wrong place on the map:

Compare with OpenStreetMap:

So now, back near home, I ask it to find a post office. Here’s me parked outside one; do you see it on the screenshots?

Again, compare with OpenStreetMap:

So I thought I’d help Garmin out, but their Report a Map Error page needs me to know the type of my GPS, its serial number, the type and revision of my map, my name and e-mail address, and the coordinates of the error. OSM has me spoiled: at best, I can go in and edit; at second best, I can drop markers on OpenStreetBugs to flag errors for others to fix.

Garmin already has my name, e-mail address, GPS type, serial number and map revision through myGarmin™. The company could just as easily have a web-based map correction system that would be point-and-click. Follow the Leader is one of Garmin’s mottoes. In terms of user correctability of maps, however, they’re only the leader because they don’t know they’ve been lapped.

APRS is go!

Automatic Packet Reporting System — APRS — is rather clever. It’s a way of reporting position, status or messages via the amateur radio 2m band. Data is relayed via digipeaters, and routed to/from the internet APRS-IS system to any user worldwide.

It’s a little fiddly to set up, even with a very polished (read: $$) handheld radio like the Kenwood TH-D72A. I’m a bit disappointed that the purported SiRFstar III GPS in this radio takes forever to get a lock, but it’s a nice radio despite this.

The screenshot above shows‘s tracking of my handheld (VA3PID-7) last night as I walked to Toronto Mappy Hour.

Mac OS X killed my Garmin!

My GPSMAP 60CSx had started to become unreliable: crashing after startup, randomly locking up in mid route, and just generally being an aggravating piece of kit. I was really close to replacing it.

The problem seemed to appear after I’d used USB Mass Storage to transfer archived track logs to the computer. As a last resort, I tried removing the hidden files that OS X creates on every removable disk, and now all is well. It’s annoying and inexcusable that Apple chooses to do this, but we work around.

To delete these files from the terminal and eject the device safely, enter these commands:

pushd /Volumes/GARMIN/
rm -rf .Spotlight-V100 .Trashes ._.Trashes .fseventsd
disktool -e disk1

Your device might not be called /Volumes/GARMIN/, so check and change appropriately. If you have multiple drives on your machine, your GPS is probably not the disk1 device. You can find out which it is by entering disktool -l.

probably wouldn’t recommend the Blackberry Tour as a GPS logger

I walked a local footpath carrying my (mostly) trusty Garmin GPSMap 60Csx, and a Blackberry Tour running bbTracker. Both had had a good satellite fix for about 10 minutes beforehand, and both were logging trackpoints every second. The smooth turquoise track from the Garmin is much more useful than the wibbly one from the Blackberry.

fallout from last night’s OSM 6th birthday Mappy Hour in Toronto

It was fun – there were geo-aware cupcakes!

In a moment of geek worlds colliding, Emma showed up, and now I have people clamouring for tablet at Mappy Hour. Sigh, those old ecommons links just don’t fade …