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.

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

Map Implementations:

RedNavigationArrow#1: firebase AIS (Westerschelde, preliminary)

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

NOTE: On termination of Google's 90 day free trial period for cloud, firebase and map API services, I had to close down parts of the firebase_ais project, to avoid billing. This link shows a historic screenshot of the firebase implementation. The link in the paragraph above leads to the current state, which is marred by an error popup and a 'for development only' watermark. Since pulling the plug on Google's billing, the satellite image also is darkened. However, the ships still refresh properly, and mouse-hover displays ship infos. This map was just a stepping stone towards the open source implementation, anyway.

RedNavigationArrow#2: opensource AIS (Westerschelde, 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 opensource_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 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 (Worldwide, 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.