Fix crash in 15m tool. Some of the larger Seattle maps have pedestrian
pathfinding disabled to save space, so make the path calculation
optional.
@@ -149,10 +149,9 @@ impl Isochrone {
Options::Biking => PathConstraints::Bike,
};
- let all_paths = self.start.iter().map(|b_id| {
- map.pathfind(PathRequest::between_buildings(map, *b_id, to, constraints).unwrap())
- .ok()
- .unwrap()
+ let all_paths = self.start.iter().filter_map(|b_id| {
+ PathRequest::between_buildings(map, *b_id, to, constraints)
+ .and_then(|req| map.pathfind(req).ok())
});
all_paths.min_by_key(|path| path.total_length())
