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
This commit is contained in:
Dustin Carlino 2018-09-07 22:25:38 -07:00
parent 3cff2cecd7
commit 6bff2113be
3 changed files with 18 additions and 5 deletions

View File

@ -51,10 +51,21 @@ impl ControlStopSign {
let r = map.get_parent(*l); let r = map.get_parent(*l);
let rank = if let Some(highway) = r.osm_tags.get("highway") { let rank = if let Some(highway) = r.osm_tags.get("highway") {
match highway.as_ref() { match highway.as_ref() {
"motorway" => 20,
"motorway_link" => 19,
"primary" => 17,
"primary_link" => 16,
"secondary" => 14,
"secondary_link" => 13,
"tertiary" => 10, "tertiary" => 10,
"tertiary_link" => 9, "tertiary_link" => 9,
"secondary" => 8,
"residential" => 5, "residential" => 5,
"unclassified" => 0,
_ => panic!("Unknown OSM highway {}", highway), _ => panic!("Unknown OSM highway {}", highway),
} }
} else { } else {

View File

@ -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 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. 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 ## Everything as FSMs

View File

@ -27,11 +27,11 @@ pub struct UI {
impl UI { impl UI {
pub fn new(window_size: Size) -> 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 // TODO this is only for debug_intersection
//canvas.cam_zoom = 7.5; //canvas.cam_zoom = 7.5;
//canvas.center_on_map_pt(1350.0, 400.0); //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 { UI {
canvas, canvas,
@ -76,12 +76,12 @@ impl gui::GUI for UI {
let mut labels: Vec<(Pt2D, String)> = Vec::new(); let mut labels: Vec<(Pt2D, String)> = Vec::new();
if true { if true {
self.debug_polygon_drawing(g, &mut labels); self.moving_polyline(g, &mut labels);
} else { } else {
self.trim_polyline(g, &mut labels); self.trim_polyline(g, &mut labels);
self.debug_intersection(g, &mut labels); self.debug_intersection(g, &mut labels);
self.moving_polyline(g, &mut labels);
self.debug_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 // TODO detect "breakages" by dist from p2 to p2_c beyond threshold