GPS Traces

Importing maps

GPS traces require a geospatial environment. We prepared a dedicated page on the topic.

GPS traces can be used to deploy nodes on a map. FromGPSTrace is a Deployment that takes care of setting the initial position of the nodes depending the first position of the GPS traces.

The class supports deploying more nodes than there are available traces by reusing them cyclically.

Click to show / hide code
Get GPS data for your experiments

The great folks at OpenStreetMap release GPS data for the whole planet. As per the map information, regional extracts are available (the full data pack is otherwise larger than 50GB uncompressed).

Alignment of time

Often, GPS traces are collected at different points in time. When this is the case, a strategy must be concted to “align” them: for instance, we may want all traces to be interpreted as beginning at the same time, regardless of the actual time they were taken; or we might want to discard the first hour of data; or maybe we want to use them just as they are.

Alignment is performed by the subclasses of it.unibo.alchemist.boundary.gps

The strategies available to align time of GPS trace are the following:

NoAlignment

No alignment is performed, traces are left untouched.

Trace Original time samples Aligned time samples
A [2, 5] [2, 5]
B [4, 6] [4, 6]

AlignToFirstTrace:

All traces get aligned to the start time of the first trace, keeping their relative distance.

Trace Original time samples Aligned time samples
A [2, 5] [0, 3]
B [4, 6] [2, 4]

AlignToSimulationTime:

Aligns all traces to the initial simulation time, not preserving relative time differences.

Trace Original time samples Aligned time samples
A [2, 5] [0, 3]
B [4, 6] [0, 2]

AlignToTime:

Aligns all traces with the given time in seconds from Epoch. Discards all points before the provided epoch, and shifts back all points located after that time to the initial simulation time, preserving relative distances

Trace Provided Epoch Original time samples Aligned time samples
A 3 [2, 5] [2]
B 3 [4, 6] [1, 3]

Examples

Click to show / hide code