2021-02-13 03:53:59 +03:00
|
|
|
#!/bin/bash
|
|
|
|
# This script procedurally generates houses for an actdev site that's already
|
|
|
|
# been imported, if the map doesn't seem to have houses mapped in OSM already.
|
|
|
|
# It's run manually once per site. It'd be better to incorporate this as a
|
|
|
|
# proper importer stage, but there's not an easy way to express that kind of
|
|
|
|
# task dependency yet.
|
|
|
|
|
|
|
|
CITY=$1
|
|
|
|
if [ "$CITY" == "" ]; then
|
|
|
|
echo Missing args;
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2021-02-14 02:45:59 +03:00
|
|
|
if cargo run --release --bin generate_houses -- --map=data/system/gb/$CITY/maps/center.bin --num_required=1000 --rng_seed=42 --out=data/input/gb/$CITY/procgen_houses.json; then
|
2021-02-13 03:53:59 +03:00
|
|
|
# Update the importer config, and import again
|
2021-02-14 02:45:59 +03:00
|
|
|
perl -pi -e "s#\"extra_buildings\": null#\"extra_buildings\": \"data/input/gb/$CITY/procgen_houses.json\"#" importer/config/gb/$CITY/cfg.json
|
2021-02-15 22:57:41 +03:00
|
|
|
./import.sh --raw --map --city=gb/$CITY
|
2021-02-13 03:53:59 +03:00
|
|
|
else
|
|
|
|
echo "$CITY already had enough houses"
|
|
|
|
fi
|