# NOT RUN {
q <- opq ("portsmouth usa") %>%
add_osm_features (features = c ("\"amenity\"=\"restaurant\"",
"\"amenity\"=\"pub\""))
# This extracts in a single query the same result as the following:
q1 <- opq ("portsmouth usa") %>%
add_osm_feature(key = "amenity",
value = "restaurant")
q2 <- opq ("portsmouth usa") %>%
add_osm_feature(key = "amenity", value = "pub")
c (osmdata_sf (q1), osmdata_sf (q2)) # all restaurants OR pubs
# }
Run the code above in your browser using DataLab