Modern Apps git

← Modern-Apps.git

maps: route_diff --no-overlay for overlay vs full-search comparisons

Commit
8268f088160e02cc963538abe94b1fdcb3259a5f
Author
vayun-mathur <[email protected]>
When
2026-10-25 03:33 UTC (1 month ago)
Parents
6cab1a7

Diff

maps/src/main/rust/examples/route_diff.rs
diff --git a/maps/src/main/rust/examples/route_diff.rs b/maps/src/main/rust/examples/route_diff.rsindex 0f4562613c..d3c43a07ea 100644--- a/maps/src/main/rust/examples/route_diff.rs+++ b/maps/src/main/rust/examples/route_diff.rs@@ -73,10 +73,10 @@ fn main() -> std::process::ExitCode { const USAGE: &str = "\ usage:   route_diff gen-pairs --graph DIR --out FILE [--count N]-  route_diff report    --graph DIR --pairs FILE --out FILE [--overlay FILE]+  route_diff report    --graph DIR --pairs FILE --out FILE [--overlay FILE | --no-overlay]   route_diff compare   --baseline FILE --candidate FILE [--tol-mm N] [--tol-10ms N]   route_diff geometry  --baseline DIR --candidate DIR-  route_diff bench     --graph DIR --pairs FILE [--passes N] [--cold] [--verbose] [--overlay FILE]+  route_diff bench     --graph DIR --pairs FILE [--passes N] [--cold] [--verbose] [--overlay FILE | --no-overlay]   route_diff dump    route_diff dump         --graph DIR --out FILE   route_diff dump-compare --baseline FILE --candidate FILE [--limit N]@@ -128,9 +128,13 @@ fn load(dir: &str) -> Result<Graph, String> {     }) } -/// [`load`], then attach `--overlay FILE` when given.+/// [`load`], then attach `--overlay FILE` when given, or drop the archive's own+/// overlay with `--no-overlay`. fn load_with_overlay(dir: &str, args: &[String]) -> Result<Graph, String> {     let mut g = load(dir)?;+    if args.iter().any(|a| a == "--no-overlay") {+        g.detach_overlay();+    }     if let Some(path) = flag(args, "--overlay") {         if !g.attach_overlay_file(&path) {             return Err(format!("{path}: not an overlay for this graph"));
maps/src/main/rust/src/graph_overlay.rs
diff --git a/maps/src/main/rust/src/graph_overlay.rs b/maps/src/main/rust/src/graph_overlay.rsindex 1e704d0f8f..21c263ffe5 100644--- a/maps/src/main/rust/src/graph_overlay.rs+++ b/maps/src/main/rust/src/graph_overlay.rs@@ -160,6 +160,11 @@ impl Graph {         self.overlay.as_ref()     } +    /// Drop the overlay so long routes use the plain full-graph search.+    pub fn detach_overlay(&mut self) {+        self.overlay = None;+    }+     /// Attach an overlay from a standalone `overlay.bin` (the graph-dir layout).     /// Returns false, leaving any current overlay in place, when it does not     /// parse or was built for a different graph.