Remove zones without homes or shops. Found one in London. This can

happen when the overlap with the map is tiny. #556
This commit is contained in:
Dustin Carlino 2021-03-05 14:53:29 -08:00
parent a7b7638405
commit 9610b69de4

View File

@ -174,6 +174,19 @@ fn create_zones(map: &Map, input: HashMap<String, Polygon>) -> HashMap<String, Z
}
}
// Remove empty zones.
zones.retain(|name, zone| {
if zone.homes.is_empty() {
warn!("{} has no homes", name);
false
} else if zone.workplaces.is_empty() {
warn!("{} has no workplaces", name);
false
} else {
true
}
});
zones
}