2021-02-10 00:53:50 +03:00
|
|
|
#!/bin/bash
|
|
|
|
# This script imports a site from
|
|
|
|
# https://github.com/cyipt/actdev/tree/main/data-small as a new city and map.
|
|
|
|
# It follows https://a-b-street.github.io/docs/howto/new_city.html.
|
|
|
|
|
|
|
|
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-02-14 02:45:59 +03:00
|
|
|
cp -Rv importer/config/gb/leeds importer/config/gb/$CITY
|
|
|
|
rm -fv importer/config/gb/$CITY/*.poly
|
2021-02-10 00:53:50 +03:00
|
|
|
wget https://raw.githubusercontent.com/cyipt/actdev/main/data-small/$SITE/small-study-area.geojson
|
|
|
|
cargo run --bin geojson_to_osmosis < small-study-area.geojson
|
|
|
|
rm -fv small-study-area.geojson
|
2021-02-14 02:45:59 +03:00
|
|
|
mv boundary0.poly importer/config/gb/$CITY/center.poly
|
|
|
|
GEOFABRIK=`cargo run --bin pick_geofabrik importer/config/gb/$CITY/center.poly`
|
2021-02-12 01:27:28 +03:00
|
|
|
echo "Geofabrik URL is $GEOFABRIK"
|
2021-02-14 02:45:59 +03:00
|
|
|
perl -pi -e "s#\"osm_url\": \".*\"#\"osm_url\": \"$GEOFABRIK\"#" importer/config/gb/$CITY/cfg.json
|
2021-02-10 00:53:50 +03:00
|
|
|
|
2021-02-10 19:35:08 +03:00
|
|
|
wget https://raw.githubusercontent.com/cyipt/actdev/main/data-small/$SITE/site.geojson -O data/system/study_areas/$SITE.geojson
|
|
|
|
|
2021-02-14 02:45:59 +03:00
|
|
|
./import.sh --raw --map --city=gb/$CITY
|
2021-02-10 00:53:50 +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-02-12 01:27:28 +03:00
|
|
|
echo "You might need to procedurally generate houses."
|
2021-02-12 03:32:27 +03:00
|
|
|
echo "And after uploading, probably want to: cargo run --bin updater -- --opt-into-all > data/player/data.json"
|