filter coordinates It doesn't work

jose juan2 years ago

I just did a fresh install of traccar, just add coordinate filter, but it doesn't work.
I've seen many examples on the forum, but none of them work.

default.xml

<properties>

    <!--

    DO NOT MODIFY THIS FILE. Use traccar.xml instead.

    -->

    <entry key='web.port'>8082</entry>
    <entry key='web.path'>./web</entry>
    <entry key='web.persistSession'>false</entry>
    
    <entry key='coordinates.filter'>true</entry>
    <entry key='coordinates.minError'>60</entry>
    <entry key='coordinates.maxError'>120</entry>

    <entry key='geocoder.enable'>true</entry>
    <entry key='geocoder.type'>nominatim</entry>
    <entry key='geocoder.url'>https://us1.locationiq.com/v1/reverse.php</entry>
    <entry key='geocoder.key'>pk.689d849289c8c63708068b2ff1f63b2d</entry>

    <entry key='logger.level'>info</entry>
    <entry key='logger.file'>./logs/tracker-server.log</entry>
    <entry key='logger.rotate'>true</entry>

    <entry key='filter.enable'>true</entry>
    <entry key='filter.future'>86400</entry>

    <entry key='event.ignoreDuplicateAlerts'>true</entry>
    <entry key='processing.computedAttributes.enable'>true</entry>
    <entry key='processing.engineHours.enable'>true</entry>

    <entry key='media.path'>./media</entry>

    <entry key='notificator.types'>web,mail</entry>

    <entry key='server.statistics'>https://www.traccar.org/analytics/</entry>

    <entry key='commands.queueing'>true</entry>

    <entry key='database.ignoreUnknown'>true</entry>
    <entry key='database.generateQueries'>true</entry>
    <entry key='database.changelog'>./schema/changelog-master.xml</entry>
 
    <entry key='database.loginUser'>
        SELECT * FROM tc_users
        WHERE email = :email OR login = :email
    </entry>

    <entry key='database.selectPositions'>
        SELECT * FROM tc_positions WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to ORDER BY fixTime
    </entry>

    <entry key='database.selectPrecedingPosition'>
        SELECT * FROM tc_positions WHERE deviceId = :deviceId AND fixTime &lt;= :time ORDER BY fixTime DESC LIMIT 1
    </entry>

    <entry key='database.selectLatestPositions'>
        SELECT tc_positions.* FROM tc_positions INNER JOIN tc_devices ON tc_positions.id = tc_devices.positionid;
    </entry>

    <entry key='database.updateLatestPosition'>
        UPDATE tc_devices SET positionId = :id WHERE id = :deviceId
    </entry>

    <entry key='database.selectEvents'>
        SELECT * FROM tc_events WHERE deviceId = :deviceId AND eventTime BETWEEN :from AND :to ORDER BY eventTime
    </entry>

    <entry key='database.selectStatistics'>
        SELECT * FROM tc_statistics WHERE captureTime BETWEEN :from AND :to ORDER BY captureTime
    </entry>

    <entry key='gps103.port'>5001</entry>
    <entry key='tk103.port'>5002</entry>

Log Traccar:

2021-12-29 18:42:20  INFO: [f5f751b8] id: 452112, time: 2021-12-29 18:40:40, lat: 19.39042, lon: -102.02333, course: 0.0
2021-12-29 18:42:20  INFO: [f5f751b8] id: 452112, time: 2021-12-29 18:40:45, lat: 19.39042, lon: -102.02333, course: 0.0
2021-12-29 18:42:23  INFO: [f5f751b8: osmand < 192.168.0.13] HEX: 504f5354202f3f69643d3435323131322674696d657374616d703d31363430383234383630266c61743d31392e333930343233333333333333333334266c6f6e3d2d3130322e30323333323939393939393939392673706565643d302e302662656172696e673d302e3026616c7469747564653d302e302661636375726163793d302e3026626174743d3130302e3020485454502f312e310d0a436f6e74656e742d547970653a206170706c69636174696f6e2f782d7777772d666f726d2d75726c656e636f6465640d0a557365722d4167656e743a2044616c76696b2f322e312e3020284c696e75783b20553b20416e64726f696420393b20414f5350206f6e20494120456d756c61746f72204275696c642f505352312e3138303732302e313232290d0a486f73743a203139322e3136382e302e31333a353035350d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a20677a69700d0a436f6e74656e742d4c656e6774683a20300d0a0d0a
2021-12-29 18:42:23  INFO: [f5f751b8: osmand > 192.168.0.13] HEX: 485454502f312e3120323030204f4b0d0a636f6e74656e742d6c656e6774683a20300d0a0d0a
2021-12-29 18:42:23  INFO: [f5f751b8] id: 452112, time: 2021-12-29 18:41:00, lat: 19.39042, lon: -102.02333, course: 0.0
2021-12-29 18:42:29  INFO: [f5f751b8: osmand < 192.168.0.13] HEX: 504f5354202f3f69643d3435323131322674696d657374616d703d31363430383234383635266c61743d31392e333930343233333333333333333334266c6f6e3d2d3130322e30323333323939393939393939392673706565643d302e302662656172696e673d302e3026616c7469747564653d302e302661636375726163793d302e3026626174743d3130302e3020485454502f312e310d0a436f6e74656e742d547970653a206170706c69636174696f6e2f782d7777772d666f726d2d75726c656e636f6465640d0a557365722d4167656e743a2044616c76696b2f322e312e3020284c696e75783b20553b20416e64726f696420393b20414f5350206f6e20494120456d756c61746f72204275696c642f505352312e3138303732302e313232290d0a486f73743a203139322e3136382e302e31333a353035350d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a20677a69700d0a436f6e74656e742d4c656e6774683a20300d0a0d0a
2021-12-29 18:42:29  INFO: [f5f751b8: osmand > 192.168.0.13] HEX: 485454502f312e3120323030204f4b0d0a636f6e74656e742d6c656e6774683a20300d0a0d0a
2021-12-29 18:42:29  INFO: [f5f751b8] id: 452112, time: 2021-12-29 18:41:05, lat: 19.39042, lon: -102.02333, course: 0.0

DataBase

Description text

You can guide me in what I am doing wrong, I want to prevent the plot received when the car is parked from being saved in the database

Anton Tananaev2 years ago

You should read the documentation carefully again.

henry beltran2 years ago

this is extracted from a file (keys configuration.xml, which I can't find on github anymore)

  / **
 * Replace the coordinates with the last known ones if the change is less than one 'coordinates.minError' meters
 * or more than one meter of 'coordinates.maxError'. Helps avoid coordinate jumps during parking period
 * or jumps to zero coordinates.
 * /
Public static final ConfigKey COORDINATES_FILTER = new ConfigKey (
        "<key input = 'coordinates.filter'> true </entry>", boolean class);

/ **
 * Distance in meters. Distances below this value are handled as explained in 'coordinates.filter'.
 * /
Public static final ConfigKey COORDINATES_MIN_ERROR = new ConfigKey (
        "<key entry = 'coordinates.minError'> 20 </entry>", Integer.class);

/ **
 * Distance in meters. Distances above this value are handled as explained in 'coordinates.filter', but only if
 * The position is also marked as "invalid".
 * /
Public static final ConfigKey COORDINATES_MAX_ERROR = new ConfigKey (
        "<key entry = 'coordinates.maxError'> 30000 </entry>", Integer.class); "

In your configuration you have:

"<key entry = 'coordinates.maxError'> 120 </entry>"

this value should be in thousands of meters 30000 for example, perhaps there is the problem.

I am struggling to obtain the best possible configuration, I have certain problems with the detection of stops using Chinese devices