You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider a case where we move along the equator. For the simplicity sake the trajectory points are reported at 1 hour intervals. The trajectory is as follows:
starting at lat=0 deg and lon=0 deg
flying to lat=0 deg and lon=7.186609624 deg, i.e. 800 km/h w.r.t. the previous point
driving to lat=0 deg and lon=7.5458541615 deg, i.e. 40 km/h w.r.t. the previous point
continue the trajectory along the equator at 40 km/h.
With a speed limit set at 50 km/h it is expected to remove only the second point, where the limit was exceeded.
This scenario is represented with the following code snippet
i = 0, compare i+1 with i, the speed is 800 km/h, above the limit, remove i+1 point, continue without incrementing index i
i = 0, compare i+1 with I (so i=2 and i=0 of the original array), the speed is 420 km/h, above the limit, remove i+1 point, continue without incrementing index I
i = 0, compare i+1 with I (so i=3 and i=0 of the original array), the speed is 293 km/h, above the limit, remove i+1 point, continue without incrementing index I
...
It seems that the filtering algorithm was designed to eliminate singular points that moved at high speed. However, the same method fails if the high-speed movement was permanent, e.g., flying or traveling on a highway.
Could you please confirm my findings? If that is the case, then I'll happily work on the issue.
The text was updated successfully, but these errors were encountered:
Hi!
I started using your library lately and came across an unexpected behaviour in speed-based filtering function: https://github.com/scikit-mobility/scikit-mobility/blob/master/skmob/preprocessing/filtering.py#L115
Consider a case where we move along the equator. For the simplicity sake the trajectory points are reported at 1 hour intervals. The trajectory is as follows:
lat=0 deg
andlon=0 deg
lat=0 deg
andlon=7.186609624 deg
, i.e. 800 km/h w.r.t. the previous pointlat=0 deg
andlon=7.5458541615 deg
, i.e. 40 km/h w.r.t. the previous pointThis scenario is represented with the following code snippet
Which does not meet the expectation.
Having studied the code, it appears that the
continue
in line https://github.com/scikit-mobility/scikit-mobility/blob/master/skmob/preprocessing/filtering.py#L142 is responsible for this behaviour.Let's follow the execution of the loop:
i = 0
, comparei+1
withi
, the speed is 800 km/h, above the limit, removei+1
point, continue without incrementing index ii = 0
, comparei+1
with I (soi=2
andi=0
of the original array), the speed is 420 km/h, above the limit, removei+1
point, continue without incrementing index Ii = 0
, comparei+1
with I (soi=3
andi=0
of the original array), the speed is 293 km/h, above the limit, removei+1
point, continue without incrementing index IIt seems that the filtering algorithm was designed to eliminate singular points that moved at high speed. However, the same method fails if the high-speed movement was permanent, e.g., flying or traveling on a highway.
Could you please confirm my findings? If that is the case, then I'll happily work on the issue.
The text was updated successfully, but these errors were encountered: