From 6bff2113beafc545f2378008700c55b1d461c8f6 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Fri, 7 Sep 2018 22:25:38 -0700 Subject: [PATCH] more OSM types so medium map doesn't immediately crash. trying to fix bad polyline projection in another branch, but don't have it working yet --- control/src/stop_signs.rs | 13 ++++++++++++- docs/design.md | 2 ++ editor/src/experimental.rs | 8 ++++---- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/control/src/stop_signs.rs b/control/src/stop_signs.rs index f085839c97..cdc7d81c2f 100644 --- a/control/src/stop_signs.rs +++ b/control/src/stop_signs.rs @@ -51,10 +51,21 @@ impl ControlStopSign { let r = map.get_parent(*l); let rank = if let Some(highway) = r.osm_tags.get("highway") { match highway.as_ref() { + "motorway" => 20, + "motorway_link" => 19, + + "primary" => 17, + "primary_link" => 16, + + "secondary" => 14, + "secondary_link" => 13, + "tertiary" => 10, "tertiary_link" => 9, - "secondary" => 8, + "residential" => 5, + + "unclassified" => 0, _ => panic!("Unknown OSM highway {}", highway), } } else { diff --git a/docs/design.md b/docs/design.md index 42c144863e..a16852789c 100644 --- a/docs/design.md +++ b/docs/design.md @@ -735,6 +735,8 @@ loading GTFS is actually a bit unclear -- both the map layer and the sim layer have to parse the same GTFS? well, it's like RoadEdits -- we can pass it into the map constructor and physically just load it once. +routing: https://stackoverflow.com/questions/483488/strategy-to-find-your-best-route-via-public-transportation-only + ## Everything as FSMs diff --git a/editor/src/experimental.rs b/editor/src/experimental.rs index e39a298243..057a8a3979 100644 --- a/editor/src/experimental.rs +++ b/editor/src/experimental.rs @@ -27,11 +27,11 @@ pub struct UI { impl UI { pub fn new(window_size: Size) -> UI { - let mut canvas = Canvas::new(window_size); + let canvas = Canvas::new(window_size); // TODO this is only for debug_intersection //canvas.cam_zoom = 7.5; //canvas.center_on_map_pt(1350.0, 400.0); - canvas.center_on_map_pt(800.0, 600.0); + //canvas.center_on_map_pt(800.0, 600.0); UI { canvas, @@ -76,12 +76,12 @@ impl gui::GUI for UI { let mut labels: Vec<(Pt2D, String)> = Vec::new(); if true { - self.debug_polygon_drawing(g, &mut labels); + self.moving_polyline(g, &mut labels); } else { self.trim_polyline(g, &mut labels); self.debug_intersection(g, &mut labels); - self.moving_polyline(g, &mut labels); self.debug_polyline(g, &mut labels); + self.debug_polygon_drawing(g, &mut labels); } // TODO detect "breakages" by dist from p2 to p2_c beyond threshold