2021-02-10 00:53:50 +03:00
|
|
|
#!/bin/bash
|
|
|
|
# This script imports a site from
|
2021-04-27 23:13:14 +03:00
|
|
|
# https://github.com/cyipt/actdev/tree/main/data-small as a new city.
|
2021-02-10 00:53:50 +03:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2021-02-12 01:30:41 +03:00
|
|
|
# This should be a directory name from https://github.com/cyipt/actdev/tree/main/data-small
|
2021-02-10 00:53:50 +03:00
|
|
|
SITE=$1
|
2021-02-12 01:30:41 +03:00
|
|
|
if [ "$SITE" == "" ]; then
|
2021-02-10 00:53:50 +03:00
|
|
|
echo Missing args;
|
|
|
|
exit 1;
|
|
|
|
fi
|
2021-02-13 00:30:59 +03:00
|
|
|
CITY=`echo $SITE | sed -r 's/-/_/g'`
|
2021-02-10 00:53:50 +03:00
|
|
|
|
2021-07-30 00:19:46 +03:00
|
|
|
# Follow https://a-b-street.github.io/docs/user/new_city.html and import as a new city.
|
2021-11-18 02:52:09 +03:00
|
|
|
mkdir -p importer/config/gb/$CITY
|
2021-07-30 00:19:46 +03:00
|
|
|
wget https://raw.githubusercontent.com/cyipt/actdev/main/data-small/$SITE/small-study-area.geojson
|
2021-09-15 05:56:16 +03:00
|
|
|
cargo run --bin cli -- geojson-to-osmosis small-study-area.geojson
|
2021-07-30 00:19:46 +03:00
|
|
|
rm -fv small-study-area.geojson
|
|
|
|
mv boundary0.poly importer/config/gb/$CITY/center.poly
|
|
|
|
|
|
|
|
wget https://raw.githubusercontent.com/cyipt/actdev/main/data-small/$SITE/site.geojson -O data/system/study_areas/$SITE.geojson
|
|
|
|
|
|
|
|
./import.sh --raw --map --city=gb/$CITY
|
|
|
|
|
|
|
|
# Procedurally generate houses, if needed
|
2022-02-03 17:40:57 +03:00
|
|
|
if cargo run --release --bin cli -- generate-houses --map=data/system/gb/$CITY/maps/center.bin --num-required=1000 --rng-seed=42 --output=data/input/gb/$CITY/procgen_houses.json; then
|
2021-11-18 02:52:09 +03:00
|
|
|
# Import again, now that the new JSON file exists
|
2021-04-27 23:13:14 +03:00
|
|
|
./import.sh --raw --map --city=gb/$CITY
|
2021-07-30 00:19:46 +03:00
|
|
|
else
|
|
|
|
echo "$CITY already had enough houses"
|
2021-04-27 23:13:14 +03:00
|
|
|
fi
|
|
|
|
|
2021-07-30 00:19:46 +03:00
|
|
|
./importer/actdev_scenario.sh $CITY
|
2021-04-27 23:13:14 +03:00
|
|
|
|
2021-02-12 02:51:52 +03:00
|
|
|
echo "You have to manually update .gitignore, map_gui/src/tools/mod.rs, release/deploy_actdev.sh"
|
2021-11-01 22:46:57 +03:00
|
|
|
echo "And after uploading, probably want to: cargo run --bin updater -- opt-into-all > data/player/data.json"
|