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

Add interpolation p2 #903

Merged
merged 13 commits into from
Sep 22, 2023
Merged

Add interpolation p2 #903

merged 13 commits into from
Sep 22, 2023

Conversation

tiffanychu90
Copy link
Member

@tiffanychu90 tiffanychu90 commented Sep 22, 2023

segment speeds

  • after moving the direction check to all shapes (not just loop_or_inlining==1 shapes), finish up rest of workflow to get speeds
    • check that low speeds were happening also on loop_or_inlining==0 shapes. we can't ignore these.
  • add a step to re-calculate speeds if pct_segment_covered < 30% (if it has 1 point, the segment would have had zero meters_elapsed, because the same point would have been chosen for first and second point within segment).
    • for these points, choose the previous vp_idx. if we're close to the origin and there's no previous point, choose the following vp_idx, and use absolute value for the distance and time calculation.
    • chose to use straight distance because the prior_vp_idx could take place on a separate segment.
      • if we use shapely.project and hit the entire shape geometry, we risk getting erroneous shape_meters calculated. no way to know if it's projecting onto the inbound vs outbound portion.
      • decide that straight distance will be close enough, if points are close together (yes, these are consecutive vps), while handling the fact that they may not fall on consecutive segments
  • add a flag_recalculated column to track whether the speed was calculated again with straight distance
  • adjust avg_speeds script to remove the pct_segment argument. it now appears in an earlier step.
  • future TODO: should we add a map_partitions way of calculating? test a full run in oct to see how long it's taking, now that we swapped some steps, see how it's shaking out
  • future TODO: now that direction check occurs earlier, we can apply this workflow to road segments, which would not have a loop_or_inlining flag

@tiffanychu90 tiffanychu90 merged commit d0de40e into main Sep 22, 2023
@tiffanychu90 tiffanychu90 deleted the add-interpolation-p2 branch September 22, 2023 16:58
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

Successfully merging this pull request may close these issues.

Research Request - Second try for low speeds + fix only 1 vp within segment
1 participant