MobilityDB 1.3
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
03_ais_assemble.c File Reference

A simple program that reads AIS data from a CSV file, constructs trips from these records, and outputs for each trip the MMSI, the number of instants, and the distance travelled. More...

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <meos.h>
#include <meos_geo.h>

Data Structures

struct  AIS_record
 
struct  trip_record
 

Macros

#define MAX_INSTANTS   50000
 
#define MAX_LENGTH_HEADER   1024
 
#define MAX_LENGTH_POINT   64
 
#define MAX_LENGTH_TIMESTAMP   32
 
#define MAX_TRIPS   5
 
#define NO_INSTANTS_BATCH   10000
 

Functions

int main (void)
 

Detailed Description

A simple program that reads AIS data from a CSV file, constructs trips from these records, and outputs for each trip the MMSI, the number of instants, and the distance travelled.

The program also stores in a CSV file the assembled trips.

Please read the assumptions made about the input file in the file 02_ais_read.c in the same directory. Furthermore, the program assumes the input file contains less than 50K observations for at most five ships. Also, the program does not cope with erroneous inputs, such as two or more observations for the same ship with equal timestamp values and supposes that the observations are in increasing timestamp value.

The program can be build as follows

gcc -Wall -g -I/usr/local/include -o 03_ais_assemble 03_ais_assemble.c -L/usr/local/lib -lmeos