mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 23:43:25 +03:00
clip_trips breaking on some huge_seattle border intersections; just omit them
This commit is contained in:
parent
de8e5d6295
commit
509936cd43
@ -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| {
|
||||
|
Loading…
Reference in New Issue
Block a user