From 0e99f401503b4f3fc5d38bb91699d36259529858 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Tue, 3 Dec 2019 11:55:54 -0800 Subject: [PATCH] merge data/shapes and data/input. stop keeping around raw .kmls. adjust gitignore to make it easier to spot defunct files in my repo --- .gitignore | 11 +++++++++-- abstutil/src/lib.rs | 2 +- import.sh | 14 ++++++++------ precompute.sh | 2 +- release/common.sh | 3 --- tests/src/map_conversion.rs | 4 ++-- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index cad4b8d8ca..66f38e48b6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ data/ab_test_saves/* data/ab_tests/* data/camera_state/* data/edits/* -data/input/* data/maps/* data/neighborhoods/* data/raw_maps/* @@ -15,5 +14,13 @@ data/saves/* data/scenarios/* data/screenshots/*/*.png data/screenshots/*/combine.sh -data/shapes/* data/shortcuts/* + +data/input/*.osm +data/input/blockface.bin +data/input/google_transit_2018_18_08 +data/input/offstreet_parking.kml +data/input/parcels_urbansim.txt +data/input/popdat.bin +data/input/sidewalks.bin +data/input/trips_2014.csv diff --git a/abstutil/src/lib.rs b/abstutil/src/lib.rs index 8b0963a9eb..3916fd3312 100644 --- a/abstutil/src/lib.rs +++ b/abstutil/src/lib.rs @@ -128,7 +128,7 @@ pub fn path_polygon(polygon_name: &str) -> String { } pub fn path_popdat() -> String { - format!("../data/shapes/popdat.bin") + format!("../data/input/popdat.bin") } pub fn path_raw_map(map_name: &str) -> String { diff --git a/import.sh b/import.sh index a0bc108e23..bbd7245b10 100755 --- a/import.sh +++ b/import.sh @@ -64,25 +64,27 @@ for poly in `ls data/polygons/`; do fi done -if [ ! -f data/shapes/blockface.bin ]; then +if [ ! -f data/input/blockface.bin ]; then # From http://data-seattlecitygis.opendata.arcgis.com/datasets/blockface get_if_needed https://opendata.arcgis.com/datasets/a1458ad1abca41869b81f7c0db0cd777_0.kml data/input/blockface.kml; cd kml time cargo run --release -- \ --input=../data/input/blockface.kml \ - --output=../data/shapes/blockface.bin + --output=../data/input/blockface.bin + rm -f data/input/blockface.kml; cd .. fi -if [ ! -f data/shapes/sidewalks.bin ]; then +if [ ! -f data/input/sidewalks.bin ]; then # From https://data-seattlecitygis.opendata.arcgis.com/datasets/sidewalks get_if_needed https://opendata.arcgis.com/datasets/ee6d0642d2a04e35892d0eab77d971d6_2.kml data/input/sidewalks.kml; cd kml time cargo run --release -- \ --input=../data/input/sidewalks.kml \ - --output=../data/shapes/sidewalks.bin + --output=../data/input/sidewalks.bin + rm -f data/input/sidewalks.kml; cd .. fi @@ -101,11 +103,11 @@ for poly in `ls ../data/polygons/`; do rm -rf ../data/neighborhoods/$name ../data/maps/${name}.bin; RUST_BACKTRACE=1 cargo run $release -- \ --osm=../data/input/$name.osm \ - --parking_shapes=../data/shapes/blockface.bin \ + --parking_shapes=../data/input/blockface.bin \ --offstreet_parking=../data/input/offstreet_parking.kml \ --gtfs=../data/input/google_transit_2018_18_08 \ --neighborhoods=../data/input/neighborhoods.geojson \ --clip=../data/polygons/$name.poly \ --output=../data/raw_maps/$name.bin - #--sidewalks=../data/shapes/sidewalks.bin \ + #--sidewalks=../data/input/sidewalks.bin \ done diff --git a/precompute.sh b/precompute.sh index 6398a4152e..3a5c6cc8a8 100755 --- a/precompute.sh +++ b/precompute.sh @@ -5,7 +5,7 @@ set -e mkdir -p data/maps/ # Need this first -if [ ! -f data/shapes/popdat.bin ]; then +if [ ! -f data/input/popdat.bin ]; then # We probably don't have this map yet. if [ ! -f data/maps/huge_seattle.bin ]; then cd precompute; diff --git a/release/common.sh b/release/common.sh index 0b599c84e5..dee39d235e 100755 --- a/release/common.sh +++ b/release/common.sh @@ -14,7 +14,4 @@ function common_release { mkdir -p $OUT/data/scenarios/$map cp -v data/scenarios/$map/weekday_typical_traffic_from_psrc.bin $OUT/data/scenarios/$map/ done - - mkdir $OUT/data/shapes - cp -v data/shapes/popdat.bin $OUT/data/shapes } diff --git a/tests/src/map_conversion.rs b/tests/src/map_conversion.rs index 9a5c90c950..88a57f5548 100644 --- a/tests/src/map_conversion.rs +++ b/tests/src/map_conversion.rs @@ -4,9 +4,9 @@ pub fn run(t: &mut TestRunner) { t.run_slow("convert_osm_twice", |_| { let flags = convert_osm::Flags { osm: "../data/input/montlake.osm".to_string(), - parking_shapes: Some("../data/shapes/blockface.bin".to_string()), + parking_shapes: Some("../data/input/blockface.bin".to_string()), offstreet_parking: Some("../data/input/offstreet_parking.kml".to_string()), - sidewalks: Some("../data/shapes/sidewalks.bin".to_string()), + sidewalks: Some("../data/input/sidewalks.bin".to_string()), gtfs: Some("../data/input/google_transit_2018_18_08".to_string()), neighborhoods: Some("../data/input/neighborhoods.geojson".to_string()), clip: Some(abstutil::path_polygon("montlake")),