-
Notifications
You must be signed in to change notification settings - Fork 3
Modal Metric methodology tweaks #170
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
Changes from all commits
42fce67
9025115
5fdbecf
902f21c
cef1bcf
8442fa0
868629c
6f3fac4
b1b6ca9
73f6817
607ca4c
76ef4fd
116cb0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,18 +47,20 @@ where | |
| E: SpatialEdge + EdgeForModalMetric, | ||
| V: VertexForModalMetric, | ||
| { | ||
| // general walk-eligibility based on edge attributes and neighbors. | ||
| let is_walk_eligible = is_walk_eligible(rtree, entry); | ||
| // general walk-eligibility based on edge attributes. | ||
| let is_walk_eligible = is_walk_eligible(entry); | ||
|
admrtin marked this conversation as resolved.
|
||
|
|
||
| // grab the neighboring edges | ||
| let neighboring_edges = find_neighboring_edges(entry, rtree); | ||
|
|
||
| if !is_walk_eligible { | ||
| // Total WCI score = Min WCI score (unwalkable edge) | ||
| WciComponents::min_wci() | ||
| } else if entry.edge.is_footway() || (neighboring_edges.is_empty() && entry.edge.is_sidewalk()) | ||
| } else if entry.edge.is_footway() | ||
| || entry.edge.is_pedestrian_priority() | ||
| || (neighboring_edges.is_empty() && entry.edge.is_sidewalk()) | ||
| { | ||
| // Total WCI score = Max WCI score (footway or sidewalk with no adjacent edges) | ||
| // Total WCI score = Max WCI score (footway, pedestrian-priority street, or sidewalk with no adjacent edges) | ||
| WciComponents::max_wci() | ||
| } else { | ||
| // Compute all component scores. | ||
|
|
@@ -135,6 +137,9 @@ mod test { | |
| fn is_footway(&self) -> bool { | ||
| self.footway | ||
| } | ||
| fn is_pedestrian_priority(&self) -> bool { | ||
| false | ||
| } | ||
| fn is_unbikeable(&self) -> bool { | ||
| false | ||
| } | ||
|
|
@@ -271,17 +276,17 @@ mod test { | |
| footway: false, | ||
| speed_limit: Some(45), | ||
| cycleway: None, | ||
| linestring: LineString::from(vec![(-105.170016, 39.773648), (-105.165381, 39.774176)]), | ||
| linestring: LineString::from(vec![(-105.170735, 39.773087), (-105.170445, 39.773137)]), | ||
| }; | ||
|
|
||
| // the "buffing" edge | ||
| let neighbor = TestEdge { | ||
| id: 43, | ||
| walkable: true, | ||
| sidewalk: false, | ||
| footway: false, | ||
| speed_limit: Some(25), | ||
| cycleway: Some(CyclewayTag::DedicatedNoBuffer), | ||
| linestring: LineString::from(vec![(-105.168085, 39.773772), (-105.166755, 39.773937)]), | ||
| cycleway: Some(CyclewayTag::DedicatedWithBuffer), | ||
| linestring: LineString::from(vec![(-105.170612, 39.773116), (-105.170499, 39.773017)]), | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This commit updated the test coordinates so that the neighboring edge's centroid falls within the 15m R-tree search radius. In the previous commit, the centroids were slightly over 15m apart at ~25m. This caused the test to fail because no neighbors were assigned to the query edge. But this is a good failure because it means that the new R-tree squared neighbor distance (~1.8e-8°) is correctly enforcing the 15m threshold that we want. Moving the geometries slightly closer allowed the test to pass. |
||
| }; | ||
|
|
||
| let src_vertex = TestVertex { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.