# NOT RUN {
# This example uses the \code{osmdata} package to extract data from
# a named bounding box
# }
# NOT RUN {
library (magrittr)
library (osmdata)
bb <- osmdata::getbb ("melbourne, australia")
coast <- extract_osm_objects (bbox = bb, key = "natural", value = "coastline",
return_type = "line")
coast <- osm_line2poly (coast, bbox = bb)
# The following map then colours in just the ocean:
map <- osm_basemap (bbox = bb) %>%
add_osm_objects (coast$sea, col = "lightsteelblue") %>%
print_osm_map ()
# }
Run the code above in your browser using DataLab