I'm noticing an issue with trip distance calculation in Traccar. When a trip starts and ends at the same address, Traccar reports a negative distance (-1.64 km) even though the trip duration was about 1 hour.
Here is an example API response
[
{
"deviceId": 12345,
"deviceName": "Vehicle 123",
"distance": -1640.72,
"averageSpeed": 22.44,
"maxSpeed": 53.99,
"spentFuel": 0.0,
"startOdometer": 97482252.84,
"endOdometer": 97480612.12,
"startPositionId": 18812500019,
"endPositionId": 18811982696,
"startLat": 25.2587616,
"startLon": 55.3367533,
"endLat": 25.2587433,
"endLon": 55.336845,
"startTime": "2025-01-06T16:42:20.000+0000",
"startAddress": "Some Address, Dubai, UAE",
"endTime": "2025-01-06T18:07:32.000+0000",
"endAddress": "Some Address, Dubai, UAE",
"duration": 5112000,
"driverUniqueId": "XXXXXXXXX",
"driverName": null
}
]
The distance is negative (-1.64 km) even though the trip lasted 85 minutes.
The odometer reading is lower at the end than at the start.
The start and end GPS coordinates are nearly identical.
What will be the cause for this issue ?
Most likely is one of the two:
- Your device reported incorrect odometer
- Your device reported data in incorrect order, so server distance was calculated incorrectly
I'm noticing an issue with trip distance calculation in Traccar. When a trip starts and ends at the same address, Traccar reports a negative distance (-1.64 km) even though the trip duration was about 1 hour.
Here is an example API response
The distance is negative (-1.64 km) even though the trip lasted 85 minutes.
The odometer reading is lower at the end than at the start.
The start and end GPS coordinates are nearly identical.
What will be the cause for this issue ?