working on west seattle

This commit is contained in:
Dustin Carlino 2020-05-14 12:03:19 -07:00
parent f6bd936c53
commit 95a0f2f620
10 changed files with 47 additions and 29 deletions

2
Cargo.lock generated
View File

@ -2904,7 +2904,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "seattle_traffic_signals"
version = "0.1.0"
source = "git+https://github.com/dabreegster/seattle_traffic_signals#6a891d38f2515deb593fb6464ad17056351c26e9"
source = "git+https://github.com/dabreegster/seattle_traffic_signals#e405c128568e6170469678f6ee405d5050adb86a"
dependencies = [
"include_dir 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -13,7 +13,7 @@ data/input/raw_maps/lakeslice.bin,f2c18735bdec05e32af4d420bcc91b31,https://www.d
data/input/raw_maps/montlake.bin,e8a42be882a9dbbf4b06c5d7d47e62d5,https://www.dropbox.com/s/qk8rhwr6vdm79vz/montlake.bin.zip?dl=0
data/input/raw_maps/mt_baker.bin,dc0185fd8e335fc103ccd1eb9dc2e66e,https://www.dropbox.com/s/nr18iu83lrcyg8e/mt_baker.bin.zip?dl=0
data/input/raw_maps/udistrict.bin,2ab86343fec0846ab3e4eb3518cbf04a,https://www.dropbox.com/s/o1gtavxtw8n3bhy/udistrict.bin.zip?dl=0
data/input/raw_maps/west_seattle.bin,60e133d121e042f80646869ee5df0c0e,https://www.dropbox.com/s/112ym2cwg643c9n/west_seattle.bin.zip?dl=0
data/input/raw_maps/west_seattle.bin,63deafa83bfe1aab247927c1f4064b44,https://www.dropbox.com/s/112ym2cwg643c9n/west_seattle.bin.zip?dl=0
data/input/screenshots/lakeslice/01x01_i325.gif,40b1e76bb29e46823fa52186c891578b,https://www.dropbox.com/s/uiodmxawv8sheb1/01x01_i325.gif.zip?dl=0
data/input/screenshots/lakeslice/01x02_i163.gif,bbe0f33acd8fa1cf8fe5028bea8cc9a2,https://www.dropbox.com/s/6zebcdhbeirab49/01x02_i163.gif.zip?dl=0
data/input/screenshots/lakeslice/01x03_i1.gif,7f29ff99e19905709bc3e94123c7959f,https://www.dropbox.com/s/qn65mm834k8w1jr/01x03_i1.gif.zip?dl=0
@ -177,7 +177,7 @@ data/input/seattle/osm/montlake.osm,a3b8299d9c2c5f8d142c52f730d5ea15,https://www
data/input/seattle/osm/mt_baker.osm,ca7b12c8bc2450d9b13e476b708f10f9,https://www.dropbox.com/s/2tibw8w3q99u0f4/mt_baker.osm.zip?dl=0
data/input/seattle/osm/udistrict.osm,85b8ad49405accc449c765d27ae16293,https://www.dropbox.com/s/h66cidmzcq15pbo/udistrict.osm.zip?dl=0
data/input/seattle/osm/washington-latest.osm.pbf,bb3ae7eda2924b78d213c0ced1771818,https://www.dropbox.com/s/xha9cx696czbzlf/washington-latest.osm.pbf.zip?dl=0
data/input/seattle/osm/west_seattle.osm,f308d0ec05a801184322b4936f12f790,https://www.dropbox.com/s/8m0vmvwg5zz3uod/west_seattle.osm.zip?dl=0
data/input/seattle/osm/west_seattle.osm,f4f7848204542abf31b299ed61ff0924,https://www.dropbox.com/s/8m0vmvwg5zz3uod/west_seattle.osm.zip?dl=0
data/input/seattle/parcels_urbansim.txt,db63d7d606e8702d12f9399e87e6a00f,https://www.dropbox.com/s/6g8rbsf200dssj3/parcels_urbansim.txt.zip?dl=0
data/input/seattle/popdat.bin,977996fa2f2457dc399cfc76539df318,https://www.dropbox.com/s/wrpji7e14rdwszs/popdat.bin.zip?dl=0
data/input/seattle/sidewalks.bin,034dd47ab77902dbc81c0107f13d8965,https://www.dropbox.com/s/ma9bmisijc7v7xa/sidewalks.bin.zip?dl=0
@ -189,13 +189,13 @@ data/system/maps/caphill.bin,99f08acb29427dd7f2e6cdf106dcb3f6,https://www.dropbo
data/system/maps/downtown.bin,c0050c54a12d4b1402e412d4e42483d6,https://www.dropbox.com/s/4do5cg4vc17lafo/downtown.bin.zip?dl=0
data/system/maps/downtown_atx.bin,b2d634b8aa1244261d3a5e3a6e8b8ab7,https://www.dropbox.com/s/5avnbkd4oxby2hs/downtown_atx.bin.zip?dl=0
data/system/maps/huge_austin.bin,1993956d19e43b1d27d8417435820f23,https://www.dropbox.com/s/khy0m6v9yt0gjnt/huge_austin.bin.zip?dl=0
data/system/maps/huge_seattle.bin,d9189f24c1a791b0b5f4d81e3cb75a59,https://www.dropbox.com/s/btvr3qajshnivhb/huge_seattle.bin.zip?dl=0
data/system/maps/huge_seattle.bin,5d7e19609bf8d55058b8218c2b48c4a0,https://www.dropbox.com/s/btvr3qajshnivhb/huge_seattle.bin.zip?dl=0
data/system/maps/intl_district.bin,6a69f040ff8e8f767ad2d9582bb2b80b,https://www.dropbox.com/s/fohppni52ekc5l3/intl_district.bin.zip?dl=0
data/system/maps/lakeslice.bin,89a8d89d0ac59c6472130f5777e6dd11,https://www.dropbox.com/s/99zi0gcbyvqrkud/lakeslice.bin.zip?dl=0
data/system/maps/montlake.bin,9c98456991458bc92394e4cc89b325e7,https://www.dropbox.com/s/zvhm2j5lavixxcr/montlake.bin.zip?dl=0
data/system/maps/mt_baker.bin,adf0a19a0ab9732333b30c3af8de273c,https://www.dropbox.com/s/cetje663p04cbgp/mt_baker.bin.zip?dl=0
data/system/maps/udistrict.bin,fc01bce2955ffbe00d692e76cbcffdd8,https://www.dropbox.com/s/zqt2je8fadssz5j/udistrict.bin.zip?dl=0
data/system/maps/west_seattle.bin,545430a37de018b39e23095ad596ac42,https://www.dropbox.com/s/5pp1ik9l40yj3wh/west_seattle.bin.zip?dl=0
data/system/maps/west_seattle.bin,0c0af0fd2ad3ba86ca3e7c508238f9b5,https://www.dropbox.com/s/5pp1ik9l40yj3wh/west_seattle.bin.zip?dl=0
data/system/prebaked_results/lakeslice/weekday.bin,1b189183b68dd997601fc14a1b96f907,https://www.dropbox.com/s/1c1sohvy50263wg/weekday.bin.zip?dl=0
data/system/prebaked_results/montlake/car vs bike contention.bin,5243eb9a2d3e523728e5db7a3db2ef4e,https://www.dropbox.com/s/jefg0ikjy9dsrdd/car%20vs%20bike%20contention.bin.zip?dl=0
data/system/prebaked_results/montlake/weekday.bin,5e32cf340f1e30b09329a21a118c2e97,https://www.dropbox.com/s/1aq7n9ow8tfqb5d/weekday.bin.zip?dl=0
@ -210,4 +210,4 @@ data/system/scenarios/montlake/everyone_weekday.bin,47f5646a66eb787f7b87c03dfb20
data/system/scenarios/montlake/weekday.bin,f97303f58e12864872f29aa0c138c692,https://www.dropbox.com/s/yntrxxgv3yx75gd/weekday.bin.zip?dl=0
data/system/scenarios/mt_baker/weekday.bin,570675946de2ce07621746e8133574d0,https://www.dropbox.com/s/5e36iyuha2ltyo8/weekday.bin.zip?dl=0
data/system/scenarios/udistrict/weekday.bin,48a774696624bd88ff715835e560861d,https://www.dropbox.com/s/gz5h3pgckjn9bbj/weekday.bin.zip?dl=0
data/system/scenarios/west_seattle/weekday.bin,4f6fc8168f11ae1cc2f3c142cc807be4,https://www.dropbox.com/s/n8ertmxn05yn0kj/weekday.bin.zip?dl=0
data/system/scenarios/west_seattle/weekday.bin,27998caa0624d0cf3cb7ea1f89dd1eee,https://www.dropbox.com/s/n8ertmxn05yn0kj/weekday.bin.zip?dl=0

View File

@ -1,13 +1,13 @@
west_seattle
1
-122.39971160888670 47.497024174351175
-122.24761962890625 47.52531550240097
-122.24830627441406 47.54385891390967
-122.23903656005860 47.56123740692762
-122.26512908935547 47.58301031389572
-122.26718902587890 47.60847775345513
-122.3997116088867 47.497024174351175
-122.25050267937173 47.525922074864695
-122.27750541149004 47.53954861383009
-122.3032514436633 47.55475804245952
-122.31919709916613 47.573122031379974
-122.32603988964831 47.59802824594216
-122.39799499511719 47.60338525714934
-122.44331359863283 47.583705044846596
-122.39971160888670 47.497024174351175
-122.3997116088867 47.497024174351175
END
END

View File

@ -37,6 +37,7 @@ impl DevToolsMode {
Some(Transition::Push(polygon::PolygonEditor::new(
ctx,
app,
"name goes here".to_string(),
Vec::new(),
)))
}),
@ -69,7 +70,9 @@ fn choose_polygon(wiz: &mut Wizard, ctx: &mut EventCtx, app: &mut App) -> Option
abstutil::list_all_objects("../data/input/seattle/polygons/".to_string())
})?;
match polygon::read_from_osmosis(format!("../data/input/seattle/polygons/{}.poly", name)) {
Ok(pts) => Some(Transition::Push(polygon::PolygonEditor::new(ctx, app, pts))),
Ok(pts) => Some(Transition::Push(polygon::PolygonEditor::new(
ctx, app, name, pts,
))),
Err(err) => {
println!("Bad polygon {}: {}", name, err);
Some(Transition::Pop)

View File

@ -16,13 +16,14 @@ const LAST_PLACED_POINT: Color = Color::GREEN;
pub struct PolygonEditor {
composite: Composite,
name: String,
points: Vec<LonLat>,
mouseover_pt: Option<usize>,
moving_pt: bool,
}
impl PolygonEditor {
pub fn new(ctx: &mut EventCtx, app: &App, points: Vec<LonLat>) -> Box<dyn State> {
pub fn new(ctx: &mut EventCtx, app: &App, name: String, points: Vec<LonLat>) -> Box<dyn State> {
Box::new(PolygonEditor {
composite: WrappedComposite::quick_menu(
ctx,
@ -31,6 +32,7 @@ impl PolygonEditor {
vec![],
vec![(hotkey(Key::X), "export as an Osmosis polygon filter")],
),
name,
points,
mouseover_pt: None,
moving_pt: false,
@ -66,7 +68,7 @@ impl State for PolygonEditor {
}
"export as an Osmosis polygon filter" => {
if self.points.len() >= 3 {
save_as_osmosis(&self.points).unwrap();
save_as_osmosis(&self.name, &self.points).unwrap();
}
}
_ => unreachable!(),
@ -144,11 +146,11 @@ impl State for PolygonEditor {
}
// https://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format
fn save_as_osmosis(pts: &Vec<LonLat>) -> Result<(), Error> {
fn save_as_osmosis(name: &str, pts: &Vec<LonLat>) -> Result<(), Error> {
let path = "bounding_boy.poly";
let mut f = File::create(&path)?;
writeln!(f, "name goes here")?;
writeln!(f, "{}", name)?;
writeln!(f, "1")?;
for gps in pts {
writeln!(f, " {} {}", gps.x(), gps.y())?;

View File

@ -2,7 +2,7 @@ use crate::{trim_f64, Distance, Speed};
use abstutil::elapsed_seconds;
use instant::Instant;
use serde_derive::{Deserialize, Serialize};
use std::{cmp, f64, ops};
use std::{cmp, ops};
// In seconds. Can be negative.
// TODO Naming is awkward. Can represent a moment in time or a duration.

View File

@ -1,6 +1,6 @@
use crate::{trim_f64, Distance, Duration, EPSILON_DIST};
use serde_derive::{Deserialize, Serialize};
use std::{f64, fmt, ops};
use std::{fmt, ops};
// In meters per second. Can be negative.
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]

View File

@ -11,6 +11,7 @@ struct Job {
raw_to_map: bool,
scenario: bool,
scenario_everyone: bool,
seq: bool,
only_map: Option<String>,
@ -30,6 +31,8 @@ fn main() {
scenario: args.enabled("--scenario"),
// Produce a variation of the weekday scenario including off-map trips.
scenario_everyone: args.enabled("--scenario_everyone"),
// Don't use multiple threads for conversion. Useful when needing to see errors.
seq: args.enabled("--seq"),
// Only process one map. If not specified, process all maps defined by clipping polygons in
// data/input/$city/polygons/.
@ -78,7 +81,7 @@ fn main() {
if job.raw_to_map {
// TODO Bug: if regenerating map and scenario at the same time, this doesn't work.
if job.scenario {
if job.scenario || job.seq {
utils::raw_to_map(&name);
} else {
let name = name.clone();

View File

@ -13,14 +13,20 @@ pub fn download(output: &str, url: &str) {
std::fs::create_dir_all(Path::new(output).parent().unwrap())
.expect("Creating parent dir failed");
println!("- Missing {}, so downloading {}", output, url);
let tmp = "tmp_output";
run(Command::new("curl")
.arg("--fail")
.arg("-L")
.arg("-o")
.arg(tmp)
.arg(url));
if url.ends_with(".kml") && Path::new(&output.replace(".bin", ".kml")).exists() {
run(Command::new("cp")
.arg(output.replace(".bin", ".kml"))
.arg(tmp));
} else {
println!("- Missing {}, so downloading {}", output, url);
run(Command::new("curl")
.arg("--fail")
.arg("-L")
.arg("-o")
.arg(tmp)
.arg(url));
}
// Argh the Dropbox URL is .zip?dl=0
if url.contains(".zip") {

View File

@ -626,7 +626,9 @@ fn allow_block_the_box(osm_node_id: i64) -> bool {
// 23rd and Rainier
osm_node_id == 53212741 || osm_node_id == 3496255252 ||
// Rainier and Dearborn
osm_node_id == 4607162574
osm_node_id == 4607162574 ||
// WA 509 and WA 99
osm_node_id == 31327525
}
// TODO Various problems (bad geometry, multi-intersection turn restrictions) cause
@ -638,6 +640,8 @@ fn allow_conflicting_turns(osm_node_id: i64) -> bool {
29449863, 29464223, 3391701882, 3391701883,
// Boyer and Lynn
3978753095,
// WA 509 and WA 99
31253092
]
.contains(&osm_node_id)
}