Skip to main content

GPS Trajectories and Movement Data

A trajectory is an ordered set of observations about a moving feature, not a perfectly observed path. Each fix combines position, time, coordinate reference system, acquisition method, and uncertainty. Missing fixes and ambiguous positions are data, not cleanup inconveniences.

Prerequisites​

Complete geocoding and location privacy. Apply its purpose, consent, precision, retention, and safe-sharing contract before collecting a trace.

Learning goals​

  • Validate identifiers, time ordering, CRS, accuracy radius, and observation status.
  • Distinguish observed points, interpolated segments, stops, trips, and inferred routes.
  • Expose missing and ambiguous observations rather than silently smoothing them away.
  • Explain sampling, clock, projection, privacy, and ground-truth limitations.

Observations versus movement​

The synthetic trace contains six scheduled observations in EPSG:32633: five positions, one missing observation, and one low-precision ambiguous fix. Its accuracy_m field is an uncertainty radius supplied by the fixture contract, not a guarantee that error is Gaussian or that the true point lies inside with a known probability.

Always preserve an immutable observation ID, subject or device scope, UTC timestamp, original CRS, acquisition source, accuracy metadata, and quality state. Sort by time only after detecting duplicates and clock reversals. Define session and trip breaks from the domain; a long gap can represent no signal, no movement, power loss, or collection failure.

Straight segments between fixes are chords between observations. Their sum is a lower bound on the represented polyline, not necessarily on every possible real route, and can still be longer or shorter than network travel depending on noise. Speed computed across a gap mixes unknown movement with unknown dwell time. Smoothing and interpolation create modeled positions that must remain distinguishable from observations.

Worked example​

import json
import math
from datetime import datetime
from pathlib import Path

path = Path("tests/fixtures/geospatial-data-science/movement-trace.geojson")
document = json.loads(path.read_text(encoding="utf-8"))
features = sorted(document["features"], key=lambda feature: feature["properties"]["observed_at"])
observed = [feature for feature in features if feature["geometry"] is not None]
coordinates = [feature["geometry"]["coordinates"] for feature in observed]
lower_bound = sum(math.dist(start, end) for start, end in zip(coordinates, coordinates[1:]))
times = [datetime.fromisoformat(feature["properties"]["observed_at"].replace("Z", "+00:00")) for feature in features]
missing = sum(feature["properties"]["status"] == "missing" for feature in features)
ambiguous = sum(feature["properties"]["status"] == "ambiguous" for feature in features)
max_accuracy = max(feature["properties"]["accuracy_m"] or 0 for feature in features)
print(f"crs={document['metadata']['crs']} scheduled={len(features)} time_ordered={times == sorted(times)}")
print(f"observed={len(observed)} missing={missing} ambiguous={ambiguous} max_accuracy_radius_m={max_accuracy}")
print(f"distance_lower_bound_m={lower_bound:.0f} interpolation=none gap_preserved=True")

Expected output:

crs=EPSG:32633 scheduled=6 time_ordered=True
observed=5 missing=1 ambiguous=1 max_accuracy_radius_m=60
distance_lower_bound_m=1859 interpolation=none gap_preserved=True

The calculation uses metre coordinates and preserves the missing observation. Connecting the surrounding observed points does not reconstruct what happened during the gap. No speed, stop, or transport-mode label is inferred.

Limitations and common mistakes​

  • GPS error is environment- and device-dependent; one accuracy field does not describe all biases.
  • Sampling frequency changes apparent distance, speed, stops, and route shape.
  • A stationary noisy device can resemble movement; a sparse moving device can resemble a straight line.
  • Time-zone conversion, clock drift, duplicate timestamps, and out-of-order ingestion require explicit policies.
  • Movement traces are highly identifying; pseudonyms alone do not make longitudinal locations safe to share.

Practice​

Define a trip-segmentation contract for the fixture. Specify maximum time gap, minimum stop duration, accuracy threshold, ambiguous-fix outcome, and whether interpolated points are allowed. List the privacy fields that must travel with every derived trip.

Next steps​

Next, compare observations with a road graph in road networks and map matching without treating the best score as truth.

Primary sources​

Checked 2026-10-18: OGC, Moving Features standards overview; OGC, Moving Features JSON encoding; W3C, Geolocation coordinates and accuracy; W3C/OGC, responsible use of spatial data.