mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 06:55:40 +03:00
Add Leeds (#375)
This commit is contained in:
parent
c481567ebb
commit
edf5d0d8a9
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,6 +10,7 @@ data/input/berlin/planning_areas.kml
|
||||
data/input/berlin/EWR201812E_Matrix.csv
|
||||
|
||||
data/input/krakow/osm
|
||||
data/input/leeds/osm
|
||||
|
||||
data/input/london/osm
|
||||
|
||||
|
@ -15,7 +15,7 @@ pub fn snap_cycleways(map: &RawMap, timer: &mut Timer) {
|
||||
}
|
||||
|
||||
// TODO Hack! Fix upstream problems.
|
||||
if map.name == "xian" {
|
||||
if map.name == "xian" || map.name == "leeds_center" {
|
||||
return;
|
||||
}
|
||||
|
||||
|
84
data/input/leeds/polygons/leeds_center.poly
Normal file
84
data/input/leeds/polygons/leeds_center.poly
Normal file
@ -0,0 +1,84 @@
|
||||
boundary
|
||||
1
|
||||
-1.5396 53.7759
|
||||
-1.5387 53.7757
|
||||
-1.5386 53.7802
|
||||
-1.5413 53.7829
|
||||
-1.5494 53.7848
|
||||
-1.5576 53.7828
|
||||
-1.5633 53.7802
|
||||
-1.5748 53.7792
|
||||
-1.5795 53.7766
|
||||
-1.583 53.7765
|
||||
-1.5871 53.7793
|
||||
-1.5972 53.7813
|
||||
-1.5999 53.7826
|
||||
-1.6058 53.7833
|
||||
-1.61 53.7894
|
||||
-1.6184 53.7924
|
||||
-1.6327 53.8013
|
||||
-1.6376 53.8035
|
||||
-1.6435 53.805
|
||||
-1.6481 53.8048
|
||||
-1.6521 53.803
|
||||
-1.6597 53.8018
|
||||
-1.6746 53.8016
|
||||
-1.6808 53.8034
|
||||
-1.6842 53.8065
|
||||
-1.684 53.811
|
||||
-1.6764 53.8178
|
||||
-1.6706 53.8222
|
||||
-1.6687 53.8248
|
||||
-1.6656 53.8254
|
||||
-1.652 53.8345
|
||||
-1.6486 53.8351
|
||||
-1.6436 53.8339
|
||||
-1.6378 53.835
|
||||
-1.6179 53.8365
|
||||
-1.611 53.8381
|
||||
-1.6024 53.8386
|
||||
-1.5984 53.8375
|
||||
-1.5918 53.8386
|
||||
-1.5856 53.8426
|
||||
-1.5765 53.8422
|
||||
-1.5714 53.8429
|
||||
-1.5627 53.8422
|
||||
-1.5555 53.843
|
||||
-1.5435 53.8476
|
||||
-1.5398 53.8483
|
||||
-1.5322 53.848
|
||||
-1.5207 53.8498
|
||||
-1.5048 53.8495
|
||||
-1.4966 53.8478
|
||||
-1.4943 53.8465
|
||||
-1.4886 53.8459
|
||||
-1.4814 53.8432
|
||||
-1.4783 53.8401
|
||||
-1.4675 53.8341
|
||||
-1.4587 53.8274
|
||||
-1.4556 53.8212
|
||||
-1.4524 53.8122
|
||||
-1.4519 53.8043
|
||||
-1.441 53.7977
|
||||
-1.4249 53.792
|
||||
-1.4266 53.7904
|
||||
-1.4287 53.7809
|
||||
-1.4313 53.7777
|
||||
-1.4377 53.7748
|
||||
-1.4478 53.7745
|
||||
-1.4584 53.7768
|
||||
-1.4662 53.7766
|
||||
-1.4762 53.7733
|
||||
-1.4824 53.7657
|
||||
-1.4905 53.7617
|
||||
-1.5007 53.7626
|
||||
-1.5084 53.76
|
||||
-1.5138 53.7568
|
||||
-1.515 53.7644
|
||||
-1.5187 53.7699
|
||||
-1.5281 53.7706
|
||||
-1.5374 53.7707
|
||||
-1.5403 53.7737
|
||||
-1.5396 53.7759
|
||||
END
|
||||
END
|
47
importer/src/leeds.rs
Normal file
47
importer/src/leeds.rs
Normal file
@ -0,0 +1,47 @@
|
||||
use crate::configuration::ImporterConfiguration;
|
||||
use crate::utils::{download, osmconvert};
|
||||
|
||||
fn input(config: &ImporterConfiguration) {
|
||||
download(
|
||||
config,
|
||||
"input/leeds/osm/west-yorkshire.osm.pbf",
|
||||
"https://download.geofabrik.de/europe/great-britain/england/west-yorkshire-latest.osm.pbf",
|
||||
);
|
||||
}
|
||||
|
||||
pub fn osm_to_raw(name: &str, timer: &mut abstutil::Timer, config: &ImporterConfiguration) {
|
||||
input(config);
|
||||
osmconvert(
|
||||
"input/leeds/osm/west-yorkshire.osm.pbf",
|
||||
format!("input/leeds/polygons/{}.poly", name),
|
||||
format!("input/leeds/osm/{}.osm", name),
|
||||
config,
|
||||
);
|
||||
|
||||
let map = convert_osm::convert(
|
||||
convert_osm::Options {
|
||||
osm_input: abstutil::path(format!("input/leeds/osm/{}.osm", name)),
|
||||
city_name: "leeds".to_string(),
|
||||
name: name.to_string(),
|
||||
|
||||
clip: Some(abstutil::path(format!(
|
||||
"input/leeds/polygons/{}.poly",
|
||||
name
|
||||
))),
|
||||
map_config: map_model::MapConfig {
|
||||
driving_side: map_model::DrivingSide::Left,
|
||||
bikes_can_use_bus_lanes: false,
|
||||
inferred_sidewalks: false,
|
||||
},
|
||||
|
||||
onstreet_parking: convert_osm::OnstreetParking::JustOSM,
|
||||
public_offstreet_parking: convert_osm::PublicOffstreetParking::None,
|
||||
private_offstreet_parking: convert_osm::PrivateOffstreetParking::FixedPerBldg(3), /* TODO: support amenity=parking_entrance */
|
||||
// TODO: investigate why some many buildings drop their private parkings
|
||||
elevation: None,
|
||||
include_railroads: true,
|
||||
},
|
||||
timer,
|
||||
);
|
||||
map.save();
|
||||
}
|
@ -5,6 +5,7 @@ mod berlin;
|
||||
mod configuration;
|
||||
mod dependencies;
|
||||
mod krakow;
|
||||
mod leeds;
|
||||
mod london;
|
||||
mod seattle;
|
||||
#[cfg(feature = "scenarios")]
|
||||
@ -135,6 +136,7 @@ fn main() {
|
||||
match job.city.as_ref() {
|
||||
"berlin" => berlin::osm_to_raw(&name, &mut timer, &config),
|
||||
"krakow" => krakow::osm_to_raw(&name, &mut timer, &config),
|
||||
"leeds" => leeds::osm_to_raw(&name, &mut timer, &config),
|
||||
"london" => london::osm_to_raw(&name, &mut timer, &config),
|
||||
"seattle" => seattle::osm_to_raw(&name, &mut timer, &config),
|
||||
"tel_aviv" => tel_aviv::osm_to_raw(&name, &mut timer, &config),
|
||||
|
@ -207,6 +207,7 @@ fn filter_manifest(mut manifest: Manifest, cities: Cities) -> Manifest {
|
||||
}
|
||||
"huge_seattle" => map == "huge_seattle",
|
||||
"krakow" => map == "krakow_center",
|
||||
"leeds" => map == "leeds_center",
|
||||
"berlin" => map == "berlin_center",
|
||||
"xian" => map == "xian",
|
||||
"tel_aviv" => map == "tel_aviv",
|
||||
|
Loading…
Reference in New Issue
Block a user