Skip to content

Commit

Permalink
Move the cycleway snapping step to happen just before RawMap->Map, so…
Browse files Browse the repository at this point in the history
… we can play with it in the map_editor. #330
  • Loading branch information
dabreegster committed Jul 27, 2021
1 parent 163244a commit 4547395
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions convert_osm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ mod extract;
pub mod osm_geom;
mod parking;
pub mod reader;
mod snappy;
mod split_ways;
mod transit;

Expand Down Expand Up @@ -123,10 +122,6 @@ pub fn convert(opts: Options, timer: &mut abstutil::Timer) -> RawMap {
add_extra_buildings(&mut map, path).unwrap();
}

timer.start("snap cycleways");
snappy::snap_cycleways(&mut map);
timer.stop("snap cycleways");

map.config = opts.map_config;
map
}
Expand Down
4 changes: 1 addition & 3 deletions game/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,7 @@ fn finish_app_setup(
if let Some(ref mut secondary) = app.secondary {
secondary.sim.timed_step(
&secondary.map,
// And actually, make it easier to distinguish the two maps by setting the
// alternate in the future slightly!
Duration::hours(6) + Duration::minutes(30),
Duration::hours(6),
&mut None,
&mut Timer::throwaway(),
);
Expand Down
1 change: 1 addition & 0 deletions map_model/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ anyhow = "1.0.38"
enumset = { version = "1.0.3", features=["serde"] }
fast_paths = { git = "https://github.com/easbar/fast_paths", branch = "large_edge_weights_quick_fix" }
geom = { path = "../geom" }
kml = { path = "../kml" }
log = "0.4.14"
nbez = "0.1.0"
petgraph = { version = "0.6.0", features=["serde-1"] }
Expand Down
1 change: 1 addition & 0 deletions map_model/src/make/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ mod medians;
pub mod merge_intersections;
mod parking_lots;
pub mod remove_disconnected;
pub mod snappy;
pub mod traffic_signals;
mod transit;
pub mod turns;
Expand Down
5 changes: 3 additions & 2 deletions convert_osm/src/snappy.rs → map_model/src/make/snappy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ use abstio::MapName;
use abstutil::MultiMap;
use geom::{Distance, FindClosest, Line, PolyLine};
use kml::{ExtraShape, ExtraShapes};
use map_model::raw::{OriginalRoad, RawMap};
use map_model::Direction;

use crate::raw::{OriginalRoad, RawMap};
use crate::Direction;

const DEBUG_OUTPUT: bool = false;

Expand Down
5 changes: 5 additions & 0 deletions map_model/src/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,11 @@ impl RawMap {
crate::make::collapse_intersections::trim_deadends(self);
timer.stop("trimming dead-end cycleways");

// Not sure yet about the right order for these
timer.start("snap separate cycleways");
crate::make::snappy::snap_cycleways(self);
timer.stop("snap separate cycleways");

crate::make::remove_disconnected::remove_disconnected_roads(self, timer);

timer.start("merging short roads");
Expand Down

0 comments on commit 4547395

Please sign in to comment.