I see wrong distance in some devices.

Harshana Srimala year ago

I have lot of devices in my system and I see unusual distance calculations. how to fix this? please help me

Anton Tananaeva year ago

You need to find the root cause for it.

Harshana Srimala year ago

could you assist me to find out the root cause please. I see some wrong coordinates when I check replay history.

found following details under more info. I guess it gets 0.0 coordinates.

deviceId		597
protocol	Protocol	h02
serverTime	Server Time	2023-09-15 22:21:46
deviceTime	Device Time	2023-09-15 22:21:44
fixTime	Fix Time	2023-09-15 22:21:44
outdated		No
valid	Valid	No
latitude	Latitude	0.000000°
longitude	Longitude	0.000000°
altitude	Altitude	0.00 m
speed	Speed	0.00 km/h
Anton Tananaeva year ago

Zero coordinates would explain the wrong distance, of course.

Track-tracea year ago

Have you tried to ignore zero coordinates through traccar config and then restart the server.

<entry key='filter.zero'>true</entry>
Harshana Srimala year ago

I added filter zero and also enabled coordinates filter. It won't fixed the history? isn't it fix the history?

Anton Tananaeva year ago

It won't fix history.

Harshana Srimala year ago

I used

DELETE from tc_positions WHERE latitude=0 and longitude=0;

to delete wrong positions. how to recalculate distance based on new data? is there any way to fix?

Anton Tananaeva year ago

Traccar won't recalculate historical data for you.

Harshana Srimala year ago

is there any way to do it manually? if you can let me know the formula, I will be able to recalculate it and update using sql queries.

Anton Tananaeva year ago

It should be trivial to find the distance formula. As for query, that's something you would have to figure out yourself.