|
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>#include <meos_internal.h>#include <meos_internal_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 | NUM_RECS_BATCH 100000 |
Functions | |
| int | main (void) |
| void | rec_skiplist_free (SkipList *list) |
| Specific free function for the skiplist that also frees the temporal values in the record values. More... | |
| int | trip_comp_fn (void *left, void *right) |
| void * | trip_merge_fn (void *left, void *right) |
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 uses a compilation constraint that can be used to reduce the number of records in processed. Also, the program copes with minimal error correction, that is,
The program can be build as follows