mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-28 03:35:51 +03:00
script to reimport and reprecompute a single map. add golf course areas.
This commit is contained in:
parent
b366a2dccd
commit
0c81234b56
@ -36,8 +36,8 @@ pub struct Flags {
|
||||
#[structopt(long = "residential_buildings")]
|
||||
pub residential_buildings: String,
|
||||
|
||||
/// ExtraShapes file with parcels, produced using the kml crate
|
||||
#[structopt(long = "parcels")]
|
||||
/// ExtraShapes file with parcels, produced using the kml crate. Optional.
|
||||
#[structopt(long = "parcels", default_value = "")]
|
||||
pub parcels: String,
|
||||
|
||||
/// ExtraShapes file with blockface, produced using the kml crate
|
||||
@ -80,7 +80,9 @@ pub fn convert(flags: &Flags, timer: &mut abstutil::Timer) -> raw_data::Map {
|
||||
|
||||
handle_residences(&mut map, &gps_bounds, &flags.residential_buildings, timer);
|
||||
use_parking_hints(&mut map, &gps_bounds, &flags.parking_shapes, timer);
|
||||
handle_parcels(&mut map, &gps_bounds, &flags.parcels, timer);
|
||||
if !flags.parcels.is_empty() {
|
||||
handle_parcels(&mut map, &gps_bounds, &flags.parcels, timer);
|
||||
}
|
||||
handle_traffic_signals(&mut map, &gps_bounds, &flags.traffic_signals, timer);
|
||||
map.bus_routes = gtfs::load(&flags.gtfs).unwrap();
|
||||
|
||||
|
@ -182,6 +182,9 @@ fn get_area_type(tags: &BTreeMap<String, String>) -> Option<AreaType> {
|
||||
if tags.get("leisure") == Some(&"park".to_string()) {
|
||||
return Some(AreaType::Park);
|
||||
}
|
||||
if tags.get("leisure") == Some(&"golf_course".to_string()) {
|
||||
return Some(AreaType::Park);
|
||||
}
|
||||
if tags.get("natural") == Some(&"wood".to_string()) {
|
||||
return Some(AreaType::Park);
|
||||
}
|
||||
|
38
import_and_precompute.sh
Executable file
38
import_and_precompute.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
release_mode=""
|
||||
name=""
|
||||
|
||||
for arg in "$@"; do
|
||||
if [ "$arg" == "--release" ]; then
|
||||
release_mode="--release";
|
||||
else
|
||||
name=$arg;
|
||||
fi
|
||||
done
|
||||
if [ "$name" == "" ]; then
|
||||
echo "Pass a map name";
|
||||
exit;
|
||||
fi
|
||||
|
||||
# TODO Argh, copied code! Need to detangle all the scripts.
|
||||
|
||||
rm -rf data/neighborhoods/$name data/maps/${name}_*.abst;
|
||||
|
||||
cd convert_osm;
|
||||
# Note the lack of parcels
|
||||
RUST_BACKTRACE=1 cargo run $release_mode -- \
|
||||
--osm=../data/input/$name.osm \
|
||||
--elevation=../data/input/N47W122.hgt \
|
||||
--traffic_signals=../data/input/traffic_signals.kml \
|
||||
--residential_buildings=../data/input/residential_buildings.kml \
|
||||
--parking_shapes=../data/shapes/blockface \
|
||||
--gtfs=../data/input/google_transit_2018_18_08 \
|
||||
--neighborhoods=../data/input/neighborhoods.geojson \
|
||||
--clip=../data/polygons/$name.poly \
|
||||
--output=../data/raw_maps/$name.abst
|
||||
|
||||
cd ../precompute;
|
||||
RUST_BACKTRACE=1 cargo run $release_mode ../data/raw_maps/$name.abst --edits_name=no_edits;
|
Loading…
Reference in New Issue
Block a user