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

Research Request - "super" project to deal with inlining / looping routes #705

Closed
tiffanychu90 opened this issue Apr 4, 2023 · 1 comment
Assignees
Labels
gtfs-rt Work related to GTFS-Realtime research request Issues that serve as a request for research (summary and handoff)

Comments

@tiffanychu90
Copy link
Member

tiffanychu90 commented Apr 4, 2023

Complete the below when receiving a research request, and continue to add to this issue as you receive additional details and produce deliverables. Be sure to also add the appropriate project-level label to this issue (eg gtfs-rt, DLA).

Research Question

Single sentence description: Handle inlining / loopy edge cases correctly while cutting segments. shapely.project will not give us clean chunks to easily slice up a shape's geometry for these edge cases Add a "super project" function to do it in with more detail (consider prior and subsequent stops while dealing with current stop).

Detailed description:

  • Set up shapes and stops to be comprised of 3 points and draw a vector / arrow from it
    • For a stop of interest, we look to the prior and subsequent stop to get at directionality
    • vectors: vec1.x = (x2-x1) and vec1.y = (y2-y1)...use projected CRS to take difference -- stop vector
    • do the same for vec2 -- shape vector
    • Take dot product: vec1.x*vec2.x + vec1.y*vec2.y
  • Dot product
    • +1 / >0: same direction
    • -1 / <0: opposite direction
    • 0 = orthogonal
  • retry if it is not positive (0 or negative) after removing these erroneous coords from the shape geom. anticipate we should only retry a couple times.
  • loop_utils currently identifies these edge cases, but potentially needs to be expanded because it's looking at a stop being revisited. This might not identify all the possible inlining if it's not revisiting the same stop_id while on the same trip. Expand function to identify our universe of cases.

How will this research be used?

Use this to correctly slice up stop-to-stop segments.

Deliverables:

  • Add a script to handle these edge cases for cutting stop segments.
  • TODO: check how vehicle positions end up attaching to these correctly cut segments. We might want to tighten the buffer then for these cases.
    • Note: Greg Newmark's paper: spatial accuracy. 50m necessary for freeways, but for local roads, something like 20m can grab most of the points (for the select operators he looked at).
@tiffanychu90 tiffanychu90 added gtfs-rt Work related to GTFS-Realtime research request Issues that serve as a request for research (summary and handoff) labels Apr 4, 2023
@tiffanychu90 tiffanychu90 self-assigned this Apr 4, 2023
@tiffanychu90
Copy link
Member Author

tiffanychu90 commented Apr 4, 2023

super_project

Help from @ian-r-rose!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gtfs-rt Work related to GTFS-Realtime research request Issues that serve as a request for research (summary and handoff)
Projects
None yet
Development

No branches or pull requests

1 participant