trackintel
trackintel copied to clipboard
BUG: tour generation fails with staypoints if location ID is NaN
Tour generation has two options: either merging tours via staypoints if they are at the same location, or merging them via the geographic distance of the trips' start and end point. If the first option is used, all staypoints require to have a location ID. So far, we only check whether the location_id
column exists. However, when DBSCAN is used with min_samples>1
, the location ID can be NaN. We should probably just extend the assert statement here and add something like and not any(pd.isna(sp["location_id"]))