vitalidze / traccar-web

Traccar Web UI mod
http://traccar.litvak.su/
151 stars 145 forks source link

[Help Needed] Invalid locations, avg speed and distance #1137

Open gsiotas opened 7 years ago

gsiotas commented 7 years ago

screenshot

Hi! I have the above archive list from a car from 09:28:17 to 09:36:40. The problem is that all the points from 09:29 (as you can see from the screenshot there are 4 points to that minute are invalid as the coordinates from the GPS device were off by approximately 90km.

My question is as I haven't disable the filter and I have checked the checkbox "Hide invalid locations" shouldn't traccar omit those 4 points? Also the avg speed (as you can down at the right corner of the picture is 23.03 km/h. That's also wrong as the distance was 183.93km for approximately 8 min.

How "Hide invalid locations" checkbox works and how traccar calculates avg speed? Is it traccar-web that does the calculations or should I refer to traccar.

Thanks! Notice: I have omit lan/long info for privacy reasons.

vitalidze commented 7 years ago

My question is as I haven't disable the filter and I have checked the checkbox "Hide invalid locations" shouldn't traccar omit those 4 points?

There is an "invalid" flag in each position. Some devices report this flag and thus it is stored in traccar database. When "Hide invalid locations" is checked positions are hidden based on that flag. No calculations are performed. This data is received in the traccar backend.

Also the avg speed (as you can down at the right corner of the picture is 23.03 km/h. That's also wrong as the distance was 183.93km for approximately 8 min.

Average speed is calculated based on the values from "speed" column as the mathematical mean value. Distance is not considered in calculation. This calculation is done by traccar-web.

gsiotas commented 7 years ago

image

Thanks for your prompt and precise answer!

Is there a way to implement such functionality (ignoring invalid locations) either on the filter tab (such as the quick screenshot I made) or in the report area? I mean it should be useful for everyone, I think, if there is the option to not show points on the map that are invalid even if the GPS device hasn't flagged them as invalid. I have seen it in many of my devices that sometimes the GPS gives totally wrong coordinates, usually this happens during startup until the GPS "locks" more satellites and becomes more accurate.

Thank you for the consideration.

vitalidze commented 7 years ago

It's not a trivial task to decide which positions are "invalid". I have added a new filter for one of private projects, which was called filter by "speed". Speed is calculated using time and distance between points. If speed is higher than some reasonable value, say 300 km/h, than such position was filtered out on the "backend" side, and it wasn't event appearing in the database. Probably similar logic may be applied in the UI as well.