diff --git a/docs/development.md b/docs/development.md index 8407bed5a3..ebe362d74b 100644 --- a/docs/development.md +++ b/docs/development.md @@ -91,3 +91,11 @@ java -jar ~/Downloads/josm-tested.jar ~/abstreet/map_editor/parking_diff.osc Press (and release T), then click to pan. Download a relevant layer, select the .osc, merge, then upload. + +## Fresh data + +http://download.geofabrik.de/north-america/us/washington.html + +wget http://download.geofabrik.de/north-america/us/washington-latest.osm.pbf + +osmosis --read-pbf ~/Downloads/washington-latest.osm.pbf --bounding-polygon file=~/abstreet/data/polygons/huge_seattle.poly completeWays=true --write-xml ~/Seattle.osm diff --git a/map_editor/src/model.rs b/map_editor/src/model.rs index 082edd9f24..5d58352a20 100644 --- a/map_editor/src/model.rs +++ b/map_editor/src/model.rs @@ -491,7 +491,7 @@ impl Model { } pub fn toggle_r_parking(&mut self, some_id: StableRoadID, prerender: &Prerender) { - // Assume every road matching the way is the same. + // Update every road belonging to the way. let osm_id = self.map.roads[&some_id].osm_tags[osm::OSM_WAY_ID].clone(); let matching_roads = self .map @@ -505,6 +505,32 @@ impl Model { } }) .collect::>(); + + // Verify every road has the same parking tags. Blockface hints might've applied to just + // some parts. If this is really true, then the way has to be split. Example is McGraw St. + let both = self.map.roads[&matching_roads[0]] + .osm_tags + .get(osm::PARKING_BOTH); + let left = self.map.roads[&matching_roads[0]] + .osm_tags + .get(osm::PARKING_LEFT); + let right = self.map.roads[&matching_roads[0]] + .osm_tags + .get(osm::PARKING_RIGHT); + for r in matching_roads.iter().skip(1) { + let tags = &self.map.roads[r].osm_tags; + if tags.get(osm::PARKING_BOTH) != both + || tags.get(osm::PARKING_LEFT) != left + || tags.get(osm::PARKING_RIGHT) != right + { + println!( + "{} and {} belong to same way, but have different parking tags!", + matching_roads[0], r + ); + return; + } + } + for id in matching_roads { self.road_deleted(id);