ropensci / osmdata

R package for downloading OpenStreetMap data
https://docs.ropensci.org/osmdata
317 stars 45 forks source link

[available_tags] <some available values missing for a tag> #332

Open xiaofanliang opened 1 year ago

xiaofanliang commented 1 year ago

Hi osmdata team,

This is not a very urgent request but I want to put it out for thoughts. I am pulling OSM data globally to run analyses on a set of amenities. I notice that some values available in the OSM dataset are missing when I run available_tags('amenity'). I only tested one tag and I assume this is why the line add_osm_features("amenity"=EXAMPLE BELOW) does not return any data.

More specifically, for amenity tag, these are some of the missing values: canteen, lavoir, coworking_space, social_club, marae, stage, concert_hall, festival_grounds, events_centre, dojo, karaoke_box, hookah_lounge, clubhouse. They can be found in TagInfo: https://taginfo.openstreetmap.org/keys/amenity#values and have more than 1000 instances around the world.

I also noticed that these values are missing from the source for the available_tags() function: https://wiki.openstreetmap.org/wiki/Map_features.

I am not sure what is the best way to approach this. Are these values missed because they have low counts?? If so, simply excluding them may be unfair to some regions. For example, marae is a very specific (and important) type of religious institution for New Zealand and the Pacific Islands. Not being able to pull and map them seems unfair to the natives.

jmaspons commented 1 year ago

Hello!

available_tags just download and parse https://wiki.openstreetmap.org/wiki/Map_features. Therefore, it only shows the tags in the wiki. Check the criteria for inclusion in the wiki and discuss them with the community if you would like to change them. Anyway, with osmdata you can query all kind of objects by tag, being in the wiki or not. Just add a add_osm_features("amenity") or the key/s and tag/s that you want.

mpadge commented 1 year ago

@jmaspons I agree entirely with you, but maybe we should issue a message from the function itself explaining that it only returns what is in the main = English-language wiki page, and so may not reflect local specifics? @xiaofanliang Would that help your concerns here?

xiaofanliang commented 1 year ago

Thanks for the responses! I realized that as @jmaspons said, the key and values in the available_tags() actually do not impact data pulling. As a test, I was able to pull marae POI from New Zealand. I thought (previously) that only values in the available_tags() functions can be used in osmdata, but this is not the case.

This is quite minor and it is up to you whether an additional message is necessary; I learn from CRAN document that the available_tags() function comes from https://wiki.openstreetmap.org/wiki/Map_features.