|
MobilityDB 1.3
|
A simple program that reads AIS data from a CSV file containing one full day of observations provided by the Danish Maritime Authority in https://web.ais.dk/aisdata/, constructs for each ship temporal values for the trip and the SOG, and outputs for each ship the MMSI, the number of records and instants used for contruct the temporal values, the distance travelled and the time-weighted average of the SOG. More...
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <meos.h>#include <meos_geo.h>Data Structures | |
| struct | AIS_record |
| struct | trip_record |
Macros | |
| #define | INITIAL_INSTS 64 |
| #define | MAX_LEN_LINE 1024 |
| #define | MAX_LEN_POINT 64 |
| #define | MAX_LEN_STRING 64 |
| #define | MAX_LEN_TIMESTAMP 32 |
| #define | MAX_NUM_RECS 20000000 |
| #define | MAX_NUM_SHIPS 6500 |
| #define | NUM_RECS_BATCH 100000 |
Functions | |
| int | main (void) |
A simple program that reads AIS data from a CSV file containing one full day of observations provided by the Danish Maritime Authority in https://web.ais.dk/aisdata/, constructs for each ship temporal values for the trip and the SOG, and outputs for each ship the MMSI, the number of records and instants used for contruct the temporal values, the distance travelled and the time-weighted average of the SOG.
Please notice that the data directory DOES NOT contain the input CSV file, you must download it from the website above.
Please read the assumptions made about the input CSV file in the file 02_ais_read.c in the same directory. The program assumes that the input file contains at most a given number of records for at most a given number of ships, as defined by two compilation constraints. Also, the program copes with minimal error correction, that is,
The program can be build as follows