Back to top

Online Mobility Tracking Against Evolving Maritime Trajectories

This hands-on material concerns research techniques that may be used for mobility tracking over trajectories of vessels monitored over a large maritime area. The focus is on maintaining summarized representations of such trajectories in online fashion based on surveillance data streams broadcast through Automatic Identification System (AIS) and concerning positions from a fleet of numerous vessels.

We provide source code of several generic, state-of-the-art trajectory simplification algorithms that can offer concise summaries of each trajectory as it evolves. Instead of retaining every incoming position, such methods drop any predictable positions along trajectory segments of normal motion characteristics with minimal loss in accuracy. Note that each algorithm specifies its own parametrization, which may require careful fine-tuning depending on the characteristics of the available AIS data.

This video simulates the simplified synopsis of a vessel trajectory sailing from the port of Thessaloniki, moving across the Aegean Sea, and finally reaching Rhodes. Note that this simplification algorithm also identifies critical points, i.e., it annotates each retained point in this synopsis with a particular characterization (stop, turn, slow motion, etc.) that captures important changes across the route in online fashion:

AIS Data Preparation

Download the [P1] AIS

Uncompress this .zip file and locate the path to the uncompressed nari_dynamic.csv file. This file contains AIS positions reported by more than 5000 vessels navigating close to Brest, Brittany, France.

In order to apply any of the available trajectory simplification algorithms, you have to create separate .CSV files for each trajectory. You can utilize a custom Python script in order to automatically create these trajectory files. Open this script for editing and spacify correct paths to directories that contain the input CSV file, as well as the directory to hold the output trajectory files.

Optionally, this script also offers extra filters over the initial dataset. You can specify any combination (or none) of the following filters:

  • Only keep records regarding vessels with specific identifiers (MMSI).
  • Only keep records with timestamps within a given interval.
  • Only keep records reporting locations within a specific polygonal area (a user-defined bounding box).
You may specify your chosen parameters for any filter, reflecting the contents of the AIS dataset.

To run this custom script and generate the trajectory files, execute this command (NOTE: you must have Python already installed in your machine):
python ../code/utilities/

By default, all output CSV files will contain three columns (longitude, latitude, timestamp) separated by a space character (' '). Lon/lat coordinates are expected in WGS84, whereas timestamp values should be in seconds elapsed since 1 January 1970 00:00:00GMT.

Take a look at the contents of such a raw trajectory file produced by this process.

Trajectory Simplification Algorithms

To facilitate their usage against trajectories from AIS positions, custom editions for some representative algorithms have been created. Each of these customized implementations accept a trajectory file as input (as produced in the preprocessing step). Paths to the input and output CSV files, as well as the necessary parametrization must be specified at execution time. You may download a single bundle that contains the source code for these custom implementations, along with sample data, usage examples, indicative parameter settings, and preprocessing scripts.

You must compile each of the implemented algorithms in order to run the executable. Once the source code has been compiled successfully, you may apply its executable on a dataset (e.g., a trajectory CSV file) without recompilation.
NOTE: you need to have already installed a recent version of the necessary programming language compiler (e.g., Java JDK, GNU C++ compiler, Python) in your system.

Custom Editions Working over AIS Trajectories Available for the Following Simplification Methods

It should be stressed that each algorithm is sensitive to proper choice of parameter values, which also differ amongst algorithms. Fixed parametrizations applicable to any dataset are rather difficult to specify, as setting suitable parameter values requires careful data exploration.

Execution results from each algorithm include the simplified trajectory (in CSV format), as well as a number of statistics printed in the terminal:

  • Execution time (in milliseconds) measures the performance efficiency of the method. Note that methods are developed in different programming frameworks and languages, hence their comparison in terms of execution time would not be fair.
  • Compression ratio is the percentage (%) of locations dropped from the simplified representation compared to the positions available in the original trajectory. Values closer to 0 indicate a poor compression, whereas values closer to 1 signify a more aggressive compression (i.e., light-weight simplification results).
  • Root Mean Square Error (RMSE) measures the approximation error between the original and simplified sequences of locations for a given trajectory. The lesser this error, the less the simplified trajectory deviates from the original one all along its course.

The resulting CSV files with the simplified trajectories can be visualized in GIS (e.g., in QGIS), in order to be comparatively inspected against the original vessel tracks.

Material (2013-2020) compiled by Kostas Patroumpas
mailto: kpatro AT imis DOT athena-innovation DOT gr
Information Management Systems Institute,
Athena Research Center, Greece.
Last updated: 10 September 2020 18:24:00 EET