Correlate some more activities with OSM tags. (#423)

Thanks to Tom Skinner (@trskinner) for the patch!
This commit is contained in:
Michael Kirk 2020-12-10 21:55:56 -08:00 committed by GitHub
parent 634b6ad375
commit 5c09e24225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 1 deletions

View File

@ -73,6 +73,8 @@ pub enum Activity {
School,
Entertainment,
Errands,
Financial,
Healthcare,
Home,
Work,
}

View File

@ -72,7 +72,62 @@ fn find_building_for_activity(
) -> Option<BuildingID> {
// What types of OpenStreetMap amenities will satisfy each activity?
let categories: HashSet<&'static str> = match activity {
Activity::Entertainment => vec!["cinema", "theatre"],
Activity::Breakfast => vec!["cafe"],
Activity::Lunch => vec!["pub", "food_court", "fast_food"],
Activity::Dinner => vec!["restaurant", "theatre", "biergarten"],
Activity::School => vec![
"college",
"kindergarten",
"language_school",
"library",
"music_school",
"university",
],
Activity::Entertainment => vec![
"arts_centre",
"casino",
"cinema",
"community_centre",
"fountain",
"gambling",
"nightclub",
"planetarium",
"public_bookcase",
"pool",
"dojo",
"social_centre",
"social_centre",
"studio",
"theatre",
"bar",
"bbq",
"bicycle_rental",
"boat_rental",
"boat_sharing",
"dive_centre",
"internet_cafe",
],
Activity::Errands => vec![
"marketplace",
"post_box",
"photo_booth",
"recycling",
"townhall",
],
Activity::Financial => vec!["bank", "atm", "bureau_de_change"],
Activity::Healthcare => vec![
"baby_hatch",
"clinic",
"dentist",
"doctors",
"hospital",
"nursing_home",
"pharmacy",
"social_facility",
"veterinary",
"childcare",
],
Activity::Work => vec!["bank", "clinic"],
// TODO Fill this out. amenity_type in map_gui/src/tools/mod.rs might be helpful. It might
// also be helpful to edit the list of possible activities in lib.rs too.
_ => vec![],