Import Loop 101, adding an option to skip local roads to cut down map

size.
This commit is contained in:
Dustin Carlino 2021-07-08 10:25:36 -07:00
parent c5113b868c
commit 1539091453
11 changed files with 39 additions and 0 deletions

View File

@ -473,6 +473,10 @@ fn is_road(tags: &mut Tags, opts: &Options) -> bool {
return false;
}
if opts.skip_local_roads && osm::RoadRank::from_highway(highway) == osm::RoadRank::Local {
return false;
}
// It's a road! Now fill in some possibly missing data.
// If there's no parking data in OSM already, then assume no parking and mark that it's

View File

@ -37,6 +37,9 @@ pub struct Options {
pub include_railroads: bool,
/// If provided, read polygons from this GeoJSON file and add them to the RawMap as buildings.
pub extra_buildings: Option<String>,
/// Only include highways and arterials. This may make sense for some region-wide maps for
/// particular use cases.
pub skip_local_roads: bool,
}
/// What roads will have on-street parking lanes? Data from

View File

@ -1870,6 +1870,11 @@
"uncompressed_size_bytes": 2176986,
"compressed_size_bytes": 212077
},
"data/input/us/phoenix/osm/loop101.osm": {
"checksum": "2cc9e883d2465ad98e5e903b2e92446d",
"uncompressed_size_bytes": 171331716,
"compressed_size_bytes": 13420769
},
"data/input/us/phoenix/osm/tempe.osm": {
"checksum": "c9c02b15ae350e6f288d7f9088bfc7e4",
"uncompressed_size_bytes": 7649993,
@ -1880,6 +1885,11 @@
"uncompressed_size_bytes": 657708,
"compressed_size_bytes": 115762
},
"data/input/us/phoenix/raw_maps/loop101.bin": {
"checksum": "b7c48d27d40027a08515416dd4f6a610",
"uncompressed_size_bytes": 41535721,
"compressed_size_bytes": 6767089
},
"data/input/us/phoenix/raw_maps/tempe.bin": {
"checksum": "eaa875374d4766316732c12075bf1009",
"uncompressed_size_bytes": 1760861,
@ -3940,6 +3950,11 @@
"uncompressed_size_bytes": 3237618,
"compressed_size_bytes": 1099306
},
"data/system/us/phoenix/maps/loop101.bin": {
"checksum": "d1282f68c47f2fa8d6be170f301c6e44",
"uncompressed_size_bytes": 52575756,
"compressed_size_bytes": 17200501
},
"data/system/us/phoenix/maps/tempe.bin": {
"checksum": "f80952a9099d7069587845441ffe00fe",
"uncompressed_size_bytes": 8293766,

View File

@ -0,0 +1,9 @@
boundary
1
-112.22946166992188 33.62491152150041
-111.85592651367188 33.62491152150041
-111.85592651367188 33.688924428426475
-112.22946166992188 33.688924428426475
-112.22946166992188 33.62491152150041
END
END

View File

@ -201,6 +201,7 @@ fn import_map(
private_offstreet_parking: convert_osm::PrivateOffstreetParking::FixedPerBldg(1),
include_railroads: true,
extra_buildings: None,
skip_local_roads: false,
},
timer,
);

View File

@ -79,6 +79,8 @@ impl GenericCityImporter {
private_offstreet_parking: self.private_offstreet_parking.clone(),
include_railroads: self.include_railroads,
extra_buildings: self.extra_buildings.clone(),
// TODO Total hack! Need to figure out how to express per-map config overrides
skip_local_roads: name == MapName::new("us", "phoenix", "loop101"),
},
timer,
);

View File

@ -361,6 +361,7 @@ fn oneshot(osm_path: String, clip: Option<String>, drive_on_right: bool, opts: R
private_offstreet_parking: convert_osm::PrivateOffstreetParking::FixedPerBldg(1),
include_railroads: true,
extra_buildings: None,
skip_local_roads: false,
},
&mut timer,
);

View File

@ -158,6 +158,7 @@ pub async fn osm_to_raw(name: &str, timer: &mut Timer<'_>, config: &ImporterConf
// They mess up 16th and E Marginal badly enough to cause gridlock.
include_railroads: false,
extra_buildings: None,
skip_local_roads: false,
},
timer,
);

View File

@ -67,6 +67,7 @@ impl Model {
),
include_railroads: true,
extra_buildings: None,
skip_local_roads: false,
},
&mut timer,
)

View File

@ -199,6 +199,7 @@ pub fn nice_map_name(name: &MapName) -> &str {
("nyc", "midtown_manhattan") => "Midtown Manhattan",
("nyc", "downtown_brooklyn") => "Downtown Brooklyn",
("phoenix", "gilbert") => "Gilbert",
("phoenix", "loop101") => "Loop 101 (no local roads)",
("phoenix", "tempe") => "Tempe",
("providence", "downtown") => "Providence",
("seattle", "arboretum") => "Arboretum",

View File

@ -63,6 +63,7 @@ fn import_map(path: String) -> Map {
private_offstreet_parking: convert_osm::PrivateOffstreetParking::FixedPerBldg(0),
include_railroads: true,
extra_buildings: None,
skip_local_roads: false,
},
&mut timer,
);