Modal Metric methodology tweaks - #170
Conversation
| 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)]), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
🟡 Changes recommended
Cycleway precedence and the exposed CLI option do not fully satisfy issue #166, with key regressions also untested.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates WCI/LTS methodology and modal-metric CLI handling for issue #166.
Changes:
- Uses typed modal-metric selection.
- Refines OSM walking and cycling classifications.
- Restricts walk eligibility and spatial neighbors.
File summaries
| File | Description |
|---|---|
rust/bambam/src/bin/bambam_util.rs |
Updates modal-metric CLI input. |
rust/bambam-osm/src/model/osm/graph/osm_way_data_serializable.rs |
Expands modal tag classification. |
rust/bambam-modal-metrics/src/wci/ops.rs |
Removes neighbor-based walk eligibility. |
rust/bambam-modal-metrics/src/wci/compute_wci.rs |
Adds pedestrian-priority maximum WCI. |
rust/bambam-modal-metrics/src/network_traits/edge_for_modal_metric.rs |
Adds pedestrian-priority predicate. |
rust/bambam-modal-metrics/src/common/edge_rtree_entry.rs |
Corrects neighbor radius. |
rust/bambam-modal-metrics/src/common/bulk_compute_modal_metric.rs |
Accepts the metric enumeration directly. |
Review details
Suppressed comments (2)
rust/bambam-modal-metrics/src/common/edge_rtree_entry.rs:78
- Renaming the constant left this function's rustdoc pointing to the removed
MIN_DISTANCE_RTREE_NEIGHBOR, producing a broken intra-doc link. Update the reference to the new symbol.
DISTANCE_RTREE_NEIGHBOR,
rust/bambam-modal-metrics/src/wci/compute_wci.rs:60
- The test implementation hardcodes
is_pedestrian_priority()tofalse, so the new max-WCI branch is never exercised. Add a pedestrian-priority field/case and assert that a walkable pedestrian-priority edge receivesMAX_WCI.
} else if entry.edge.is_footway()
|| entry.edge.is_pedestrian_priority()
- Files reviewed: 7/7 changed files
- Comments generated: 5
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
robfitzgerald
left a comment
There was a problem hiding this comment.
nice catch, thank you for cleaning things up and catching that distance issue. 🚌
Some important methodology tweaks to solve:
See the issue for details.