MobilityDB 1.3
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
04_ais_stream_file.c File Reference

A simple program that reads AIS data from a CSV file, accumulates the observations in main memory and send the temporal values to an output file when they reach a given number of instants in order to free the memory and ingest the newest observations. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <meos.h>
#include <meos_geo.h>
#include <meos_internal.h>

Data Structures

struct  AIS_record
 
struct  trip_record
 

Macros

#define MAX_LEN_HEADER   1024
 
#define MAX_LEN_POINT   64
 
#define MAX_NUM_TRIPS   5
 
#define NUM_INSTS_BATCH   1000
 
#define NUM_INSTS_KEEP   2
 

Functions

int main (int argc, char **argv)
 

Detailed Description

A simple program that reads AIS data from a CSV file, accumulates the observations in main memory and send the temporal values to an output file when they reach a given number of instants in order to free the memory and ingest the newest observations.

This program is similar to 04_ais_stream_db but illustrates the use of an output file. In this setting, the expandable data structures accumulate the observations that have been received so far and append them to the file. Depending on application requirements and the available memory, the accumulated temporal values must be sent regularly to the file.

The program can be build as follows

gcc -Wall -g -I/usr/local/include -o 04_ais_stream_file 04_ais_stream_file.c -L/usr/local/lib -lmeos