[Suggested Feature] Graphs from AIS data
This is a suggestion of a feature that can be included in the project and be helpful for a range of people working with AIS data. The idea is to allow the user to extract trajectory graphs describing the relationships between ports from any database compatible with AISDB. Depending on how the graph is created, the AIS data cannot be derived from it, and, probably, Meridian can store it for future use.
The prototype attached to this issue uses AISDB to query vessels up to 5km away from the closest port, which has been transmitted at least twice since it was in the threshold. It uses an open-source list of ports, but Global Fishing Watch (GFW) has a much more extensive list with hundreds of thousands of anchorages (of different sizes) that would be beneficial for this type of research.
In this sense, some suggested features would be:
- query visits over main ports, as in the prototype;
- query visits over different types of ports (data from GFW is needed); and,
- set the type of vessel and distance from the port as variables for the user to define.
The script yields a CSV file per port with the visits separated by MMSI:
- invalid message and MMSI filtering should be optionally filtered;
- one MMSI appears only once in the file per port per visit; and,
- the same MMSI can appear again in the same port if this is related to a visit at a different time.
The graph is created by joining the multiple files and ordering the visits by time, connecting two ports every time the same vessel visited both in sequence. The connection between ports is given by the numerous ordered visits of different or the same vessels. From that data, the graph can be created in multiple ways, but it would be more helpful for each researcher to build the graph in their way and only provide these output CSV files.
Prototype: AISDB-Graph.py
Output: 0000-2021-5000.csv