Skip to content

Instantly share code, notes, and snippets.

@mthh
Last active March 23, 2022 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mthh/3a05047ca29b35d9938824ebf4fff219 to your computer and use it in GitHub Desktop.
Save mthh/3a05047ca29b35d9938824ebf4fff219 to your computer and use it in GitHub Desktop.
library(osmdata)
my_opq <- opq(bbox = bb) # Ou bb est la bbox souhaitée
# Tous les trucs "verts" (forêts, pelouses, parcs, vignes, etc.)
green1 <- my_opq %>%
add_osm_feature(key = "landuse", value = c("allotments",
"farmland","cemetery",
"forest", "grass", "greenfield",
"meadow",
"orchard", "recreation_ground",
"village_green", "vineyard")) %>%
osmdata_sf()
green3 <- my_opq %>%
add_osm_feature(key = "leisure", value = c("garden", "golf_course",
"nature_reserve", "park", "pitch")) %>%
osmdata_sf()
green4 <- my_opq %>%
add_osm_feature(key = "natural", value = c("wood", "scrub", "health",
"grassland", "wetland")) %>%
osmdata_sf()
green5 <- my_opq %>%
add_osm_feature(key = "tourism", value = c("camp_site")) %>%
osmdata_sf()
# Route
q4 <- osmdata_sf(add_osm_feature(my_opq, key = 'highway', value = '', value_exact = FALSE))
# Rail
q5 <- osmdata_sf(add_osm_feature(my_opq, key = 'railway', value = '', value_exact = FALSE))
# Surface d'eau (dont cours d'eau)
blue <- my_opq %>%
add_osm_feature(key = "natural", value = c("water")) %>%
osmdata_sf()
# Gare de grenoble
railstation <- my_opq %>%
add_osm_feature(key = "railway", value = c("station")) %>%
add_osm_feature(key = "name", value = c("Grenoble")) %>%
osmdata_sf()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment