A Combined ADS-B and AIS Map: The Hacky Way

The Online Amateur Radio Community runs an instance of tar1090 to aggregate ADS-B and MLAT data received by its members. While not strictly “amateur radio”, it’s adjacent enough that it generally sits in the area of ~50 contributors at any one time, and gives us pretty good coverage of most of the UK along with parts of France, Germany and Sweden.

The question was raised on the Discord group a few weeks back of whether there are enough people able to feed AIS data to make it worth doing anything with. The end result was no, not really—not enough folks are near enough to the coast. However, between myself and Mark 2M0IIG who runs the server side, we decided to have a quick go to see what was possible.

So can we get ships appearing in a tar1090 map?

The answer is, as I’m sure you’re expecting: “Yes, but…”

tar1090 map showing aircraft and ships

As you might imagine, there are some limitations to doing it this way. After all, displaying ships and aircraft simultaneously with the appropriate fields and persistence was exactly what I developed Plane/Sailing for. But without going to the extent of running that on the server side, what did we achieve?

On the client side, we found a useful utility called ais2adsb which does most of the work for us. This was designed for the more useful job of sending SAR aircraft data to tar1090 for when it is broadcasting AIS but not ADS-B. I applied some quick hacks to it to:

Along with the last change, I also had to remove the colon character from the standard ID form of V:nnnnnn where “n” are the last 6 digits of the MMSI.

That last sentence sounded pretty icky, and it is. Ships at sea are typically referred to by their name, with MMSI and callsign rarely used apart from Mayday calls and occasionally calls to the Coastguard. But ais2adsb is talking to tar1090 in SBS (“BaseStation”) format, and the receiving end only allows for 8 characters (and no colons!). MMSIs are a no-go (at least without extra strange encoding on the client and decoding on the server) as they are typically 9 digits. We settled on Vnnnnnnn (using the last 7 digits of the MMSI) if the callsign isn’t known yet, and using the vessel callsign if it’s known.

There’s no free text field supported in SBS either, so sadly the web UI has no way to discover and display the name of the vessel.

On the server side, Mark edited the SVG file providing the graphics for tar1090’s web map to include a ship graphic. ais2adsb invents a ICAO hex for each ship in the 0xF00000 to 0xFFFFFF range, which is normally reserved, and the server was modified to use that symbol when a hex in that range was received, and set a type of “BOAT” for it.

The end result is a combined display where vessels are displayed in grey and shown accordingly in the track list.

There are not enough OARC members with a view of the sea to make it worth taking this too much further, but in case we do, my hit list would include:

But at some point we should probably stop before we end up re-inventing Plane/Sailing again!

Comments

This is a great read and I think the combination of the two streams is useful to folks. Your plane/sailing integrates the two natively so is the best way to go.

In the shipfeeder discord there was a similar discussion which resulted in some native functionality in TAR1090 for ships. It integrates (https://github.com/jvde-github/AIS-in-TAR1090) into TAR1090 and introduced a variable “aiscatcher_server” in TAR1090. The trick was to pull GeoJSON and some sprites from AIS-catcher. It is (not) properly documented though as far as I know apart from the Discord discuission, but it creates an overlay called “aiscatcher” in TAR1090.

Example here: https://kx1t.com/tar1090/

Thanks for the article, nice to read some hacking with AIS and ADSB!

Nice, thanks for letting me know about that! It looks good, definitely something we will bear in mind if we work on a combined interface again soon!

Ramon kx1t 14 August 2024

Hi Ian – great blog!

It may be worth having a chat with Wiedehopf to integrate your improvements to the main branch of tar1090, as this is something many of us are interested in. As Jasper already wrote, W added some functionality to show AIS data as icons on the map, but your implementation also exposes much of the actual metadata.

The link to the Discord we’re on is at the top of this page - the #dev-chat channel would be the right one for this discussion.

Ramon kx1t 14 August 2024

Hi Ian – great blog!

It may be worth having a chat with Wiedehopf to integrate your improvements to the main branch of tar1090, as this is something many of us are interested in. As Jasper already wrote, W added some functionality to show AIS data as icons on the map, but your implementation also exposes much of the actual metadata.

The link to the Discord we’re on is at the top of this page - the #dev-chat channel would be the right one for this discussion.

Thanks! I’ll head on over to the Discord. Like I said above, I don’t think as OARC we want to go that much further with the integration due to lack of interest, but I might be able to help more generally as I have a fair bit of experience handling AIS data.

Kevin Elliott 15 August 2024

Nice work here! The ais2adsb that wiedehopf made is very useful. Especially for self-hosted environments. I think putting all things on a map is not only cool, but interesting, especially when you have planes mentioned via ship systems, etc.

We’ve got an alpha implementation up over at Airframes as well. It’s not totally complete, and expect some issues, but feel free to take a look.

https://alpha.globe.airframes.io

You will want to click the Layers button and enable Ships, etc.

Cheers!

Looks good! I love the colour scheme & 3D globe. What software are you using on the back end to collate the data?

Add a Comment