Open hengoren opened 4 months ago
Hi, and thanks for your interest in trackintel!
Could you provide more context for why you would like to "detect" staypoint if the data is noiseless? Concretely, the reason for the spatial aggregation.
Staypoint is initially defined as spatially and temporally aggregated records. Spatial perspective is necessary because of recording noise; thus, exact coordinates cannot be obtained. If the data is noiseless, one can simply aggregate based on time, which means passing 0 (or a small value) to dist_threshold
.
Hello Trackintel team,
My team is currently using your library to detect staypoints from positionfixes and we have made a local patch that we would like to submit as a feature of the trackintel library.
Enhancement Description
We propose adding a new keyword argument, "exact" (would be open to alternate names), to the
__create_new_staypoints
function. This argument would change the behavior of how new staypoints are created and the geometry that is assigned to new staypoints.Current Behavior
Currently, a new staypoint is created at the centroid of the unary_union of all positionfixes (when a planar projection system is defined)
Proposed Behavior with "exact" flag
When the "exact" flag is set to True, a new staypoint would occur at the mode of all positionfixes, rather than the centroid.
Rationale
We are currently working with noiseless simulated data. Since the data is noiseless, that means the staypoint locations we detect using the mode give us the exact location of the staypoint. For our downstream algorithms, knowing the precise location an agent stays at is beneficial
Example
We modified the function on an earlier version of trackintel (1.2.4), but here's a code sample (this obviously isn't compatible with
check_gdf_planar
, which wasn't relevant in our use case)