SeaWaves

Why Westerschelde?

  1. The Westerschelde is a busy shipping lane with continuous activity of a variety of vessels.
  2. There are several land-based AIS receivers, providing good coverage.
  3. I am familiar with the waterway, harbours and some of the ships.
  4. Geographic restriction limits bandwidth consumption compared to the global map.

[TL;DR]: The current Open Source map is #2: Westerschelde AIS. The worldwide map is #3: Global AIS. More information below. Basic introduction to AIS here.

Map Implementations:

RedNavigationArrow#1: Firebase AIS (Closed source, retired)

INITIAL IMPLEMENTATION (RETIRED): A local server ran the python backend, for asynchronous parsing of a regional, downsampled realtime AIS datastream. The backend script updated a Google cloud firebase database several times per second. In the JavaScript frontend, hosted on a commercial webspace, database events triggered real-time updates via API to a Google custom map, rendered on my firebase_AIS webpage.

NOTE: For reasons of precaution, I have pulled the trigger on my initial closed source implementation as of June 2024, as soon as the polyfill.io supply chain attack, which compromised many Google Maps applications, was made public. I do not want to inadvertantly put visitors of my site at risk. This link shows a historic screenshot of the Google firebase implementation. That map was just a stepping stone towards the open source implementation, anyway.

RedNavigationArrow#2: Westerschelde AIS (Open Source, stable)

USAGE: (1) Mouse 'click' or touch 'tap' on icons to display vessel info. (2) Select / unselect layers from menu in upper right corner. (3) Use slider for weighting map versus satellite transparency. (4) Ship data will auto-refresh every minute.

IMPLEMENTATION: A separate python backend parses the regional AIS datastream to a data object in memory, which is supplied to the Westerschelde_AIS JavaScript frontend as a JSON file via sftp upload, at a specified time interval (once every minute). Ships on the map are refreshed via AJAX, also once a minute. Map visualization employs the Leaflet JavaScript library. Map tiles are sourced from OpenStreetMap, Bing Aerial, and OpenSeaMap.

NOTE: The open source frontend lacks the cool realtime refresh of the initial firebase project - Update frequency is once every minute. On the other hand, it sports an elegant layer opacity slider, and displays navigational marks from OpenSeaMap.

RedNavigationArrow#3: Global AIS (Open Source, stable)

USAGE: See 'instructions' on map. Best viewed on iPad, notebook or PC. The map will look a bit cluttered on a mobile phone screen.

IMPLEMENTATION: A third python backend parses a global AIS datastream from numerous stations, which encompasses ∼40,000 ships. Coverage varies significantly between geographic regions. The backend parses ∼400 AIS-messages per second and updates the JSON to the webspace once a minute. The Global_AIS frontend is designed for manual refresh via button when zoomed out, with optional autorefresh, when zoomed in. Do not try to zoom to a worldwide view. This will propably overwhelm your browser, although it is possible (screenshot). The map initially centers on the port of Hamburg, Germany.

BACKGROUND: Unlike the VesselFinder™ or MarineTraffic™ websites, my frontend does not display pre-rendered map tiles of a shipping overlay. The frontend places each ship onto the map canvas individually. With more than 40,000 icons, browsers will freeze on most hardware when chosing a global zoom level. Zoomed in, the frontend renders only those ships, that will be visible in the current map window.

CAVEAT: The global map frontend downloads ~13 MB of ship data (∼40,000 vessels), whenever reloading or refreshing. Please mind your data allowance when using mobile connectivity without flat rate.

Dirty Wrappers and Daemons:

Both async i/o and sftp upload can be finnicky at times. During development, the backends were run via wrapper scripts, to restart the backends in case of an occasional crash. Somewhat dirty, I know - but they did the job.😇 Now that the code is stable, the backends are properly daemonized and run as system services.

Green Computing

The backends run on a headless Raspberry Pi 4, that consumes less than 5 Watts of power.

Disclaimer

This is a purely hobbyist project. I may occasionally shut down the backends. Please check the refresh timestamps on the maps. A popup window will appear, in case of ship data being older than five minutes. I process the AIS datastream strictly as is. No assurances. No warranty. No liability. In any case, these maps may not be used for navigation!

Why conceive a homemade AIS viewer?

As ever so often, the project spiraled out of hand, starting off from a sailing skipper's interest in the technical principles and data structures of AIS, including the peculiar 6-bit encoding.

Once a working solution, depending on proprietary cloud infrastructure was finished, the idea of a second implementation with open-source tools was a logical next step.

All very basic.

All just for fun.