Trip report not calculating total mileage correctly.

Paul5 years ago

Is there any way to get this to calculate the correct mileage? Do you know what's wrong?

http://40.118.240.53/images/trip-report.png

Anton Tananaev5 years ago

You need to make sure your device reports in the correct order.

Paul5 years ago

This is going to be a difficult one to figure out. I went and looked for the rest of the history that day, and it looks like it compute the mileage as +/- the identical value between the first segment on the outbound trip, and is largely ignoring road mileage.

I did a quick browse through the points in excel and I don't see anything obviously amiss, but that's not to say there isn't one datapoint hidden in there somewhere. It's likely the device did loose coverage and re-uploaded after the fact, although it should have got the times correctly. All the other ones for the month seem correct but that doesn't mean much either.

Here's a screenshot with the other trip showing and a route report export.

http://40.118.240.53/images/trip-report2.png

http://40.118.240.53/images/report.xlsx

jafar habibi5 years ago

most of devices send records in NEWEST order to notify server about its latest position. do you think there is a way to modify the code to fix this.? I have seen lots of people stuck in this issue

Paul5 years ago

Yeah, I can't guarantee the replay will be in order; only that if ordered by the date/time stamp provided by the device that it will be correct. The route view appears to correctly interpret this, but not the distance calculator.

jafar habibi5 years ago

I think it is time for traccar to support calculating distance, duration, engine hour etc when data comes in reverse order (newest to oldest). I think it should be possible to sort records by reported timestamp.

Anton Tananaev5 years ago

Feel free to send a pull request.