Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation Decisions, reason for stopped_moving_after_last #1117

Open
JGreenlee opened this issue Mar 7, 2025 · 0 comments
Open

Segmentation Decisions, reason for stopped_moving_after_last #1117

JGreenlee opened this issue Mar 7, 2025 · 0 comments

Comments

@JGreenlee
Copy link

This is an old code comment in reference to stopped_moving_after_last, which we currently have in both DwellSegmentationTimeFilter and DwellSegmentationDistFilter

    # Since we only end a trip when we start a new trip, this means that
    # the last trip that was pushed is ignored. Consider the example of
    # 2016-02-22 when I took kids to karate. We arrived shortly after 4pm,
    # so during that remote push, a trip end was not detected. And we got
    # back home shortly after 5pm, so the trip end was only detected on the
    # phone at 6pm. At that time, the following points were pushed:
    # ..., 2016-02-22T16:04:02, 2016-02-22T16:49:34, 2016-02-22T16:49:50,
    # ..., 2016-02-22T16:57:04
    # Then, on the server, while iterating through the points, we detected
    # a trip end at 16:04, and a new trip start at 16:49. But we did not
    # detect the trip end at 16:57, because we didn't start a new point.
    # This has two issues:
    # - we won't see this trip until the next trip start, which may be on the next day
    # - we won't see this trip at all, because when we run the pipeline the
    # next time, we will only look at points from that time onwards. These
    # points have been marked as "processed", so they won't even be considered.

    # There are multiple potential fixes:
    # - we can mark only the completed trips as processed. This will solve (2) above, but not (1)
    # - we can mark a trip end based on the fact that we only push data
    # when a trip ends, so if we have data, it means that the trip has been
    # detected as ended on the phone.
    # This seems a bit fragile - what if we start pushing incomplete trip
    # data for efficiency reasons? Therefore, we also check to see if there
    # is a trip_end_detected in this timeframe after the last point. If so,
    # then we end the trip at the last point that we have.

https://github.com/e-mission/e-mission-server/pull/1017/files/911c0f91bed3fbe9f66c5d7e3f6b48b7b38d85b7#r1976723382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant