osm_find | R Documentation |
Get the SF details for each requested feature. The list of OSM features is
here. Use in
conjunction with osm_bind_features
.
osm_find(bb, feature_key, feature_values)
bb |
(bounding box) the area to be queried |
feature_key |
(character) the feature key to query. Feature keys can be
found here |
feature_values |
(character) a vector of feature values to query, passed
to |
a list of sf
objects, technically an osmdata
object
## Not run:
bs <- sf::st_read("data/fires_storage/burnscar/lga_bs/lga_burnscar.shp") %>%
sf::st_transform(crs = 7844) %>%
sak::normalise_geo_names() %>%
dplyr::filter(stringr::str_detect(lga_name, "Kangaroo Island"))
# KI BS bounding box
bb <- expand_bbox(bs, exp_factor = 0)
# Query for main roads
features_raw <- osm_query_features(bb,
feature_key = "highway",
feature_values = c("motorway", "primary")
)
# Collapse all the returned sfs into one
features <- osm_bind_features(features_raw,
types = c("lines", "multilines")
)
# Take a look if you're curious
mapview::mapview(features,
zcol = "highway" # nolint
)
# Intersect with the burnscar
burnscar_features <- features %>%
sak::st_intersection_quicker(bs)
# Summarise the potential effect
osm_summarise_features(burnscar_features,
highway,
.f = "length",
units = "km"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.