Fix crash in 15m tool. Some of the larger Seattle maps have pedestrian

pathfinding disabled to save space, so make the path calculation
optional.
This commit is contained in:
Dustin Carlino 2021-11-30 06:44:05 +00:00
parent 7f71333513
commit d567366ee2

View File

@ -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())