Skip to content

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

Closed
@tiffanychu90

Description

@tiffanychu90

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).

Metadata

Metadata

Assignees

Labels

gtfs-rtWork related to GTFS-Realtimeresearch requestIssues that serve as a request for research (summary and handoff)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions