Replacing every invalid coordinate

Lukasz4 years ago

Hello,

My devices report position 0.0 and invalid marker when there is no GPS signal. I would like to replace the all invalid coordinates with the last good coordinates.
Will it fix the problem:

<entry key='coordinates.filter'>true</entry>
<entry key='coordinates.maxError'>0</entry>

I would like to add that in the testing phase I had the following configured:

<entry key = 'coordinates.filter'> true </entry>
<entry key = 'coordinates.maxError'> 10000 </entry>

and it worked OK, but one of the devices suddenly found itself on the 0.0 coordinates. I suppose the teltonika device sent couple records at one time with 0.0 coordinates and the filter did not work.
Maybe, in order for the distance to be always above the value, I should do:

<entry key = 'coordinates.filter'>true</entry>
<entry key = 'coordinates.maxError'>-1</entry>

Unfortunately, I cannot repeat that situation, so I ask.

Thanks
Lukasz

Slawek4 years ago
<entry key='filter.enable'>true</entry>
<entry key='filter.zero'>true</entry>
Slawek4 years ago

example

<entry key='distance.enable'>true</entry>

<entry key='filter.enable'>true</entry>
<entry key='filter.distance'>45</entry>
<entry key='filter.maxSpeed'>500</entry>
<entry key='filter.invalid'>true</entry>
<entry key='filter.accuracy'>70</entry>
<entry key='filter.duplicate'>true</entry>
<entry key='filter.skipLimit'>1800</entry>
<entry key='filter.future'>600</entry>
<entry key='filter.zero'>true</entry>



<entry key='report.trip.minimalTripDuration'>40</entry>
<entry key='report.trip.minimalTripDistance'>300</entry>
<entry key='report.trip.minimalParkingDuration'>300</entry>
<entry key='report.trip.minimalNoDataDuration'>1200</entry>
<entry key='report.trip.greedyParking'>true</entry>


<entry key='coordinates.filter'>true</entry> 
<entry key='coordinates.minError'>45</entry>
<entry key='event.motion.speedThreshold'>1.11</entry>
Lukasz4 years ago

Slawek, thanks for the answer, but I don't want to delete the record. The data contained therein are important to me, e.g. battery power.
Battery power is reported in every record so I can't use filter.skipAttributes. When I use the filter, I will be able to see the data from the last good record 9not acctual).

Lukasz

Slawek4 years ago

where do you see skipAttributes ? use filters whitch you want, answer for you is <entry key='filter.zero'>true</entry>

Lukasz4 years ago

But when I use:

<string key = 'filter.zero'> true </string>

then I will delete every incoming record with 0.0 coordinates, and in this record I have other data important to me.

Lukasz4 years ago

I found answer on github.
To replace ALL invalid coordinates I can use:

<entry key='coordinates.filter'>true</entry>
<entry key='coordinates.maxError'>0</entry>

because (from github):
"If distance >= maxError and new position not valid then new position coordinates will be replaced from last position."

Lukasz

Lukasz4 years ago

I've been using this setup for several days. Overall, this setting works, but I noticed that sometimes vehicles spawn at 0.0. The case concerns devices that are in the system (they already had the correct locations).
2 scenarios:

  • the vehicle enters the underground parking - no GPS, GSM is available. The frame is sent every 5 minutes, - coordinates 0.0, marker invalid. Everything works - the coordinates are replaced with those before entering the parking.
  • the vehicle enters the underground car park at 9-10-20 at 13:16 - no GPS, no GSM. I don't think it will affect, but the vehicle has the battery removed - the device is off. 9-11-20, At 7:30 the vehicle leaves the underground parking lot (battery inserted, device on). First frame sent, marker invalid, coordinates 0.0. - traccar did not replace these coordinates.

Why didn't traccar replace these coordinates?

Anton Tananaev4 years ago

Technically zeroes are perfectly valid coordinates.

Lukasz4 years ago

Thanks Anton for Your reply.
I know the zero coordinates are valid coordinates but both have marker invalid.
Coordinates.filter works in one case, not in another. I do not know why :(
My configuration:

<entry key='coordinates.filter'>true</entry>
<entry key='coordinates.maxError'>0</entry>

Both teltonika devices, same configuration.
1 situation (Coordinates.filter works good - no GPS but GSM is available):

2 situation (Coordinates.filter don't work - no GPS, no GSM):

Which could be the reason the Coordinates.filter does not work in situation 2?

Lukasz

Anton Tananaev4 years ago

You can filter messages with invalid coordinately, but you can use coordinates.filter for it.

Lukasz4 years ago

I'm just trying to use coordinates.filter for this. In case 1 (described above) it works, case 2 does not work.
I cannot delete invalid coordinates as they contain the information I need.
Previously, I filtered the invalid coordinates with filter.invalid and filter.zero, but in my company fleet one of the employees went to the underground parking lot and disconnected the device. The device wanted to report this (battery power - 0V) but traccar removed records becouse applied a filter for zero and invalid coordinates.That's why I want to use coordinates.filter.

Anton Tananaev4 years ago

Makes sense, but currently it's not supported.

Slawek4 years ago

sql query + cron
or try to hide deeper traking device

Lukasz4 years ago

Thank you Anton for the information.
Can you show me the mistake of my thinking? Because I think it should work.
All filters off.
Only enabled:

<string key = 'coordinates.filter'>true</string>
<string key = 'coordinates.maxError'>0</string>

Now, theoretically, when the device sends invalid (my devices - teltonika, mark invalid) coordinates, they should be replaced with the last vaild coordinates, because coordinates.maxError>=0.
Because in documentation:

coordinates.filter - Replaces coordinates with last known if change is less than a "coordinates.error" meters. Helps to avoid coordinates jumps during parking period
and
coordinates.maxError - Distance in meters. Distances above this value gets handled like explained in "coordinates.filter", but only if Position is also marked as "invalid".