diff --git a/popdat/src/trips.rs b/popdat/src/trips.rs index c20d1418ef..b5f514ce5c 100644 --- a/popdat/src/trips.rs +++ b/popdat/src/trips.rs @@ -155,29 +155,30 @@ pub fn clip_trips(map: &Map, timer: &mut Timer) -> (Vec, HashMap = 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> = timer.parallelize("clip trips", popdat.trips, |trip| {