Prep to import actdev again, and fix build break in game/src/lib

This commit is contained in:
Dustin Carlino 2021-02-11 14:35:32 -08:00
parent dd9ddb6e45
commit fd73166292
3 changed files with 7 additions and 4 deletions

View File

@ -93,7 +93,7 @@ pub fn main() {
if let Some(site) = args.optional("--actdev") {
let city = site.replace("-", "_");
let name = MapName::new(city, "center");
let name = MapName::new(&city, "center");
flags.sim_flags.load = name.path();
flags.study_area = Some(site);
mode = Some(sandbox::GameplayMode::Blog(name));

View File

@ -14,12 +14,13 @@ fi
CITY=${SITE/-/_}
cp -Rv importer/config/leeds importer/config/$CITY
perl -pi -e "s#\"separate_cycleways\": false#\"separate_cycleways\": true#" importer/config/$CITY/cfg.json
rm -fv importer/config/$CITY/*.poly
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
mv boundary0.poly importer/config/$CITY/$MAP.poly
GEOFABRIK=`cargo run --bin pick_geofabrik importer/config/$CITY/$MAP.poly`
mv boundary0.poly importer/config/$CITY/center.poly
GEOFABRIK=`cargo run --bin pick_geofabrik importer/config/$CITY/center.poly`
echo "Geofabrik URL is $GEOFABRIK"
perl -pi -e "s#\"osm_url\": \".*\"#\"osm_url\": \"$GEOFABRIK\"#" importer/config/$CITY/cfg.json

View File

@ -20,7 +20,9 @@ pub fn import_scenarios(map: &Map, config: &ImporterConfiguration) -> Result<()>
"https://raw.githubusercontent.com/cyipt/actdev/main/data-small/great-kneighton/desire_lines_disag.geojson",
);
let bytes = abstio::slurp_file(abstio::path("input/great_kneighton/desire_lines_disag.geojson"))?;
let bytes = abstio::slurp_file(abstio::path(
"input/great_kneighton/desire_lines_disag.geojson",
))?;
let raw_string = std::str::from_utf8(&bytes)?;
let geojson = raw_string.parse::<GeoJson>()?;
let mut baseline = Vec::new();