merge data/shapes and data/input. stop keeping around raw .kmls. adjust

gitignore to make it easier to spot defunct files in my repo
This commit is contained in:
Dustin Carlino 2019-12-03 11:55:54 -08:00
parent 72c68aa320
commit 0e99f40150
6 changed files with 21 additions and 15 deletions

11
.gitignore vendored
View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -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;

View File

@ -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
}

View File

@ -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")),