clip_trips breaking on some huge_seattle border intersections; just omit them

This commit is contained in:
Dustin Carlino 2019-08-19 12:28:25 -07:00
parent de8e5d6295
commit 509936cd43

View File

@ -155,29 +155,30 @@ pub fn clip_trips(map: &Map, timer: &mut Timer) -> (Vec<Trip>, HashMap<BuildingI
osm_id_to_bldg.insert(b.osm_way_id, b.id);
}
let bounds = map.get_gps_bounds();
// TODO Figure out why some polygon centers are broken
let incoming_borders_walking: Vec<(IntersectionID, LonLat)> = map
.all_incoming_borders()
.into_iter()
.filter(|i| !i.get_outgoing_lanes(map, LaneType::Sidewalk).is_empty())
.map(|i| (i.id, i.polygon.center().to_gps(bounds).unwrap()))
.filter_map(|i| i.polygon.center().to_gps(bounds).map(|pt| (i.id, pt)))
.collect();
let incoming_borders_driving: Vec<(IntersectionID, LonLat)> = map
.all_incoming_borders()
.into_iter()
.filter(|i| !i.get_outgoing_lanes(map, LaneType::Driving).is_empty())
.map(|i| (i.id, i.polygon.center().to_gps(bounds).unwrap()))
.filter_map(|i| i.polygon.center().to_gps(bounds).map(|pt| (i.id, pt)))
.collect();
let outgoing_borders_walking: Vec<(IntersectionID, LonLat)> = map
.all_outgoing_borders()
.into_iter()
.filter(|i| !i.get_incoming_lanes(map, LaneType::Sidewalk).is_empty())
.map(|i| (i.id, i.polygon.center().to_gps(bounds).unwrap()))
.filter_map(|i| i.polygon.center().to_gps(bounds).map(|pt| (i.id, pt)))
.collect();
let outgoing_borders_driving: Vec<(IntersectionID, LonLat)> = map
.all_outgoing_borders()
.into_iter()
.filter(|i| !i.get_incoming_lanes(map, LaneType::Driving).is_empty())
.map(|i| (i.id, i.polygon.center().to_gps(bounds).unwrap()))
.filter_map(|i| i.polygon.center().to_gps(bounds).map(|pt| (i.id, pt)))
.collect();
let maybe_results: Vec<Option<Trip>> = timer.parallelize("clip trips", popdat.trips, |trip| {