Closed zrg1993 closed 5 months ago
Hi,
Can you provide the parameters you use for running the generate_staypoints()
function? The first two rows have 15-minute intervals, which might exceed the gap_threshold
parameter, thus regarded as a time gap and not be recognized as one staypoint.
@hongyeehh
Thank you for your reply.
I used the default parameters in the generate_staypoints()
function.
The default gap_threshold
parameter is 15.0
mins. And the time gap between the first two points is 14.0
mins in the sample data above.
Would you like to have a try on your local environment using the sample data above?
The reason why no staypoint is generated is that the gap between the 2nd and 3rd pfs is larger than gap_threshold
. You need to increase the gap_threshold
parameter (which implies that you assume the user is stationary during the 2nd-3rd pfs).
The resulting staypoint will start at the 1st and end at the 3rd timestamp.
My question have no relation with the trip between point2 and point3.
I am not expecting the point2 and point3 three as staypoint at all.
My problem is the point 1 and point 2 should be one staypoint because they satisfy the options on all the parameter.
However, the output of staypoint from trackintel
is None
.
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.
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 asfalse
.https://github.com/mie-lab/trackintel/blob/0cc1782b6e48ba52f9aac63a8b13822e67da1aa5/trackintel/preprocessing/positionfixes.py#L481
Looking forward to your reply.