mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 15:02:59 +03:00
Workaround GTFS snapping problems in Geneva by forcing sidewalks on both sides of oneway roads
This commit is contained in:
parent
606a59cec5
commit
fca2e1bc87
@ -2,7 +2,7 @@ use std::collections::{HashMap, HashSet};
|
||||
|
||||
use osm::{NodeID, OsmID, RelationID, WayID};
|
||||
|
||||
use abstio::MapName;
|
||||
use abstio::{CityName, MapName};
|
||||
use abstutil::{Tags, Timer};
|
||||
use geom::{Distance, FindClosest, HashablePt2D, Polygon, Pt2D, Ring};
|
||||
use kml::{ExtraShape, ExtraShapes};
|
||||
@ -101,7 +101,7 @@ pub fn extract_osm(
|
||||
|
||||
way.tags.insert(osm::OSM_WAY_ID, id.0.to_string());
|
||||
|
||||
if is_road(&mut way.tags, opts) {
|
||||
if is_road(&mut way.tags, opts, &map.name) {
|
||||
// TODO Hardcoding these overrides. OSM is correct, these don't have
|
||||
// sidewalks; there's a crosswalk mapped. But until we can snap sidewalks properly, do
|
||||
// this to prevent the sidewalks from being disconnected.
|
||||
@ -355,7 +355,7 @@ pub fn extract_osm(
|
||||
out
|
||||
}
|
||||
|
||||
fn is_road(tags: &mut Tags, opts: &Options) -> bool {
|
||||
fn is_road(tags: &mut Tags, opts: &Options, name: &MapName) -> bool {
|
||||
if tags.is("area", "yes") {
|
||||
return false;
|
||||
}
|
||||
@ -508,6 +508,10 @@ fn is_road(tags: &mut Tags, opts: &Options) -> bool {
|
||||
{
|
||||
tags.insert(osm::SIDEWALK, "both");
|
||||
}
|
||||
// Hack for Geneva, which maps sidewalks as separate ways
|
||||
if name.city == CityName::new("ch", "geneva") {
|
||||
tags.insert(osm::SIDEWALK, "both");
|
||||
}
|
||||
} else {
|
||||
tags.insert(osm::SIDEWALK, "both");
|
||||
}
|
||||
|
@ -136,9 +136,9 @@
|
||||
"compressed_size_bytes": 375492248
|
||||
},
|
||||
"data/input/ch/geneva/raw_maps/center.bin": {
|
||||
"checksum": "afff69b7004063ae51cb8e34551d1a00",
|
||||
"uncompressed_size_bytes": 12441310,
|
||||
"compressed_size_bytes": 2737170
|
||||
"checksum": "20c12ba771f4084d1a682687a6bc18f9",
|
||||
"uncompressed_size_bytes": 12439880,
|
||||
"compressed_size_bytes": 2736375
|
||||
},
|
||||
"data/input/ch/zurich/osm/center.osm": {
|
||||
"checksum": "c2851c4c0904eb0514299840f567c27d",
|
||||
@ -3071,9 +3071,9 @@
|
||||
"compressed_size_bytes": 3838389
|
||||
},
|
||||
"data/system/ch/geneva/maps/center.bin": {
|
||||
"checksum": "77b398852dd9a533e94a13fe92a56bff",
|
||||
"uncompressed_size_bytes": 32256239,
|
||||
"compressed_size_bytes": 12082511
|
||||
"checksum": "2299dcfa0f38c52d76be64cdb18e5c16",
|
||||
"uncompressed_size_bytes": 33200833,
|
||||
"compressed_size_bytes": 12482100
|
||||
},
|
||||
"data/system/ch/zurich/city.bin": {
|
||||
"checksum": "a209c74a10aa23d23feaf25e1c057efb",
|
||||
|
Loading…
Reference in New Issue
Block a user