Skip to content

Modal Metric methodology tweaks - #170

Merged
admrtin merged 13 commits into
mainfrom
amm/modal-metric-methodology-tweaks
Sep 2, 2026
Merged

admrtin merged 13 commits into
mainfrom
amm/modal-metric-methodology-tweaks

Conversation

@admrtin

@admrtin admrtin commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Some important methodology tweaks to solve:

See the issue for details.

@admrtin admrtin linked an issue Aug 20, 2026 that may be closed by this pull request
7 tasks
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)]),

@admrtin admrtin Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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() to false, so the new max-WCI branch is never exercised. Add a pedestrian-priority field/case and assert that a walkable pedestrian-priority edge receives MAX_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.

Comment thread rust/bambam-osm/src/model/osm/graph/osm_way_data_serializable.rs Outdated
Comment thread rust/bambam/src/bin/bambam_util.rs Outdated
Comment thread rust/bambam-modal-metrics/src/common/edge_rtree_entry.rs
Comment thread rust/bambam-modal-metrics/src/wci/compute_wci.rs
Comment thread rust/bambam-modal-metrics/src/wci/ops.rs Outdated

@robfitzgerald robfitzgerald left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, thank you for cleaning things up and catching that distance issue. 🚌

@admrtin
admrtin merged commit dee65bf into main Sep 2, 2026
1 check passed
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.

Methodology tweaks for modal metrics

3 participants