I see wrong distance in some devices.

Harshana Srimal2 years ago

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

Anton Tananaev2 years ago

You need to find the root cause for it.

Harshana Srimal2 years 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 Tananaev2 years ago

Zero coordinates would explain the wrong distance, of course.

Track-trace2 years ago

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

<entry key='filter.zero'>true</entry>
Harshana Srimal2 years ago

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

Anton Tananaev2 years ago

It won't fix history.

Harshana Srimal2 years 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 Tananaev2 years ago

Traccar won't recalculate historical data for you.

Harshana Srimal2 years 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 Tananaev2 years ago

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