I have a large dataset containing GPS points of various vehicles that are recorded every 10 seconds.
I have added a new id
column to these GPS points in order to be able to connect them via the Points to Path tool by using the id
field as order field.
car_id LAT LON id
2891 4.899883 52.367300 1
2891 4.900583 52.366983 2
2891 4.901033 52.366900 3
2891 4.901100 52.366867 4
... ... ...
2891 4.901572 52.367967 82
5892 4.901794 52.369302 83
5892 4.901749 52.369442 84
5892 4.901829 52.361554 85
The resulting GPS trajectory dataset contains outlying observations (the straight lines that jump across large distances not along with the road network) which I want to remove. These route points are impossible because it would require acceleration/speed that these vehicles can not achieve.
In order to detect these unrealistically travelled distances, I would like to calculate the distance between each point to the next point in sequence (id
) for each unique car_id
. This mean that the distance to the end point of each car_id
should be zero, since there is no subsequent recorded GPS point (see below). Eventually I want to set a maximum distance depending on how far it is possible for a vehicle to get in 10 seconds (150 meters?) and filter out distances above this threshold.
car_id LAT LON id DISTANCE
2891 4.899883 52.367300 1 13
2891 4.900583 52.366983 2 2
2891 4.901033 52.366900 3 14
2891 4.901100 52.366867 4 10
... ... ... ...
2891 4.901572 52.367967 82 0
5892 4.901794 52.369302 83 9
5892 4.901749 52.369442 84 12
5892 4.901829 52.361554 85 6
Is this the best way to get rid of these outliers, and achievable in QGIS?