MobilityDB 1.3
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
ais_expand.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>
#include <meos_internal.h>

Data Structures

struct  AIS_record
 
struct  trip_record
 

Macros

#define MAX_LENGTH_HEADER   1024
 
#define MAX_LENGTH_INST   64
 
#define MAX_LENGTH_TIMESTAMP   32
 
#define MAX_TRIPS   5
 

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.

Please read the assumptions made about the input file in the file 02_ais_read.c in the same directory. Furthermore, this 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 ais_expand ais_expand.c -L/usr/local/lib -lmeos