trackintel icon indicating copy to clipboard operation
trackintel copied to clipboard

For the case that the first two point are staypoints, the output will be wrong.

Open zrg1993 opened this issue 1 year ago • 0 comments

Here is the test data I am using. I just set the first two points are near to each other and I expect they should be recognized as staypoints.

lat,lon,elevation,time,User,geometry
39.98470,115.31842,149.9616,"2008-10-23 02:45:04+00:00",0,"POINT (115.31842 39.98470)"
39.98470,115.31843,149.9616,"2008-10-23 02:59:04+00:00",0,"POINT (115.31843 39.98470)"
39.98470,116.31842,149.9616,"2008-10-23 03:45:04+00:00",0,"POINT (116.31842 39.98470)"

However, the algorithm did not return the output as I expected. I found the reason is the line below. The reason is the comparison between the original row and the pandas shift function output on the first row will ignore the difference and just regard the difference as false.

https://github.com/mie-lab/trackintel/blob/0cc1782b6e48ba52f9aac63a8b13822e67da1aa5/trackintel/preprocessing/positionfixes.py#L481

Looking forward to your reply.

zrg1993 avatar Apr 08 '24 17:04 zrg1993