MEOS
GitHub Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Simplifying Trips

meos_simplify_berlinmod.c

This program reads a CSV file containing synthetic trip data in Brussels generated by the MobilityDB-BerlinMOD generator, simplifies the trips using both Douglas-Peucker (DP) and Synchronized Euclidean Distance (SED, also known as Top-Down Time Ratio simplification), and outputs for each trip the initial number of instants and the number of instants of the two simplified trips.

The output of the program is given next.

55 records read.
0 incomplete records ignored.
Vehicle: 1, Date: 2020-06-01, Seq: 1, No. of instants: 2472, No. of instants DP: 163, No. of instants SED: 1149
Vehicle: 1, Date: 2020-06-01, Seq: 2, No. of instants: 2420, No. of instants DP: 138, No. of instants SED: 1103
Vehicle: 1, Date: 2020-06-02, Seq: 1, No. of instants: 2481, No. of instants DP: 163, No. of instants SED: 1147
...
Vehicle: 5, Date: 2020-06-04, Seq: 3, No. of instants: 99, No. of instants DP: 17, No. of instants SED: 56
Vehicle: 5, Date: 2020-06-04, Seq: 4, No. of instants: 116, No. of instants DP: 18, No. of instants SED: 58

A similar result can be obtained in MobilityDB with the following SQL query, assuming that the CSV file has been previously loaded into the trips table.

SELECT vehid, day, seqno, numInstants(trip), numInstants(simplify(trip, 2)) AS numInstantsDP,
  numInstants(simplify(trip, 2, true)) AS numInstantsSED
FROM trips
ORDER BY vehid, day, seqno;