From fca2e1bc87047c93506519007273ab3fd9e9f0ec Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Fri, 11 Mar 2022 14:35:36 +0000 Subject: [PATCH] Workaround GTFS snapping problems in Geneva by forcing sidewalks on both sides of oneway roads --- convert_osm/src/extract.rs | 10 +++++++--- data/MANIFEST.json | 12 ++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/convert_osm/src/extract.rs b/convert_osm/src/extract.rs index 8282841b9c..3c3120b3d6 100644 --- a/convert_osm/src/extract.rs +++ b/convert_osm/src/extract.rs @@ -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"); } diff --git a/data/MANIFEST.json b/data/MANIFEST.json index d8cba80f76..364fe430a8 100644 --- a/data/MANIFEST.json +++ b/data/MANIFEST.json @@ -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",