Trips
Vehicle trip records derived from raw telematics data. Includes start and end times, distance, speed statistics, and zone detection
The Trips transformation processes raw telematics data into discrete vehicle trip records. Each row in processed_common_data.trips represents one complete trip: where it started and ended, how long it took, how far the vehicle traveled, and which zones it departed from or arrived at.
The built-in transformation runs every 8 hours and covers a rolling 12-hour window of raw data. At each run, previously calculated records for that window are replaced with a fresh calculation, so the table always reflects the latest available data.
Output table: processed_common_data.trips
Each row represents one validated vehicle trip. The table is keyed on device_id and trip_start_time.
device_id
integer
Device identifier. To get the object label, join to raw_business_data.objects on device_id where is_deleted = false to avoid row multiplication from historical device assignments.
trip_start_time
timestamp
Time when the trip began. Determined by the first point of a new movement segment after a qualifying stop or data gap.
trip_end_time
timestamp
Time when the trip ended. Set to the moment the device transitioned from moving to a stop that lasted at least 5 minutes.
trip_duration
text
Trip duration formatted as HH:MI:SS.
trip_duration_seconds
numeric
Trip duration in seconds. Use this field for arithmetic calculations.
trip_distance_meters
numeric
Total trip distance in meters, calculated from the PostGIS line geometry built from all points in the trip.
avg_speed
numeric
Average speed across all points in the trip, in km/h.
max_speed
numeric
Maximum speed recorded during the trip, in km/h.
min_speed
numeric
Minimum speed recorded during the trip, in km/h.
latitude_start
numeric
Latitude of the first point of the trip, in degrees.
longitude_start
numeric
Longitude of the first point of the trip, in degrees.
altitude_start
numeric
Altitude at the start of the trip, in meters above sea level.
latitude_end
numeric
Latitude of the last point of the trip, in degrees.
longitude_end
numeric
Longitude of the last point of the trip, in degrees.
altitude_end
numeric
Altitude at the end of the trip, in meters above sea level.
points_in_trip
integer
Number of raw telematics points included in the trip. Minimum 2 for a valid trip.
start_zone
text
Name of the geofence zone that contains the trip start point, if any. Null if the start point does not fall within a defined zone.
end_zone
text
Name of the geofence zone that contains the trip end point, if any. Null if the end point does not fall within a defined zone.
The examples below show common query patterns. The basic query returns trip records for the last 7 days ordered by device and start time. The second example joins to raw_business_data.objects to include the human-readable object label alongside each trip.
How trips are built
A trip record is not a raw device reading, it is a derived entity assembled from hundreds of individual telematics points. The transformation works through the raw data in stages: first deciding which points are worth keeping, then classifying each point's movement status, then grouping points into trip segments, and finally computing the aggregate metrics that appear in the output table. Understanding this process helps you interpret results correctly and recognize when the default settings need adjusting for your fleet.
Here are the steps of the algorithm that forms a trip record:
Collecting and cleaning the input
The transformation reads the last 12 hours of data from two source tables:
tracking_data_corefor position and motion readingsstatesfor the hardware movement flag each tracker sends
Points are filtered before any further processing:
Records with zero coordinates are dropped.
Points with fewer than 3 satellites are excluded from the GNSS set.
LBS points (
satellites = -1) are the exception: they pass through for separate handling in the next step, as cell-tower positions require different validity checks before they can participate in trip detection.
Deciding whether each point represents movement
Each point is classified into one of three statuses:
moving: speed is at or above 3 km/h, and either the distance from the previous point exceeds 50 meters or the tracker's hardware movement flag is active. Both conditions prevent false positives: the distance check filters speed spikes, and the hardware flag catches genuine low-speed movement that distance alone would miss.stopped: speed is below the threshold or distance is insufficient.parked: no speed reading is available for this point.
LBS points go through an additional check before receiving a status. Any LBS point where the calculated speed between consecutive positions exceeds 200 km/h is discarded as a positioning artifact. An LBS point that passes this check and immediately follows a GNSS point may form its own single-point trip segment, covering cases where a device transitions from satellite to cell-tower positioning mid-journey. All other invalid LBS points are removed.
Grouping points into trips
With every point carrying a movement status, the transformation identifies trip boundaries. A new trip begins when:
The device produces its first data point in the processing window.
Movement resumes after a qualifying stop (minimum parking duration exceeded).
Movement resumes after a data gap (timeout exceeded).
A trip ends when:
The device has been continuously stopped for the minimum parking duration.
A data gap of the timeout length occurs while the device is not moving.
The thresholds that control these boundaries are listed in the Configuration parameters reference below.
Computing output metrics
Once trip boundaries are established, all points in each trip are aggregated into a single output row:
trip_distance_meters: derived from a PostGIS line geometry built from the ordered point sequence usingST_MakeLine.avg_speed,max_speed,min_speed: computed across all points in the trip.latitude_start,longitude_start,latitude_end,longitude_end: taken from the first and last points in the sequence.start_zone,end_zone: populated by matching start and end coordinates againstprocessed_common_data.zones_geom. A match requires the point to fall exactly within the zone boundary; no buffer is applied.
Filtering out noise before writing results
Not every trip segment that the algorithm identifies is worth keeping. Short segments caused by brief GPS recovery, stationary devices with occasional position drift, or incomplete data at the window boundary are discarded. A trip is only written to the output table when it meets all of the following conditions simultaneously:
Points in trip
At least 2
Maximum speed recorded
At least 3 km/h
Total trip distance
At least 100 meters
Trip start time
Must be determined (not null)
Trip end time
Must be determined (not null)
The following two reference sections contain the configurable parameters and the raw data scaling rules that the transformation applies internally.
Customizing the transformation
The default Trips transformation reflects Navixy's general-purpose trip detection logic. If your operational scenario requires different behavior, you can load the workflow template into Transformation Builder, modify the relevant nodes, and schedule the adjusted workflow as a custom transformation in processed_custom_data.
Customization examples
Expand the sections below to see some case-based customization examples.
Using the workflow template
Navixy provides a ready-made Trips workflow template you can load into Transformation Builder as a starting point. The template covers all processing steps described on this page, from raw data ingestion through zone matching and aggregation.
See the Templates page for the download, import instructions, and the Output node configuration for this transformation.
Next steps
Common transformations: Back to the transformation index.
Templates: Download the Trips workflow template and import it into Transformation Builder.
Transformation Builder: Learn how to work with the visual workflow editor, add nodes, and preview results.
Raw data layer: Explore the source tables that feed into the Trips transformation:
tracking_data_core,states, andzones_geom.
Last updated
Was this helpful?