Trim an osmdata object to within a bounding polygon
trim_osmdata(dat, bb_poly, exclude = TRUE)An osmdata object returned from osmdata_sf() or
osmdata_sp().
A matrix representing a bounding polygon obtained with
getbb (..., format_out = "polygon") (and possibly selected from
resultant list where multiple polygons are returned).
If TRUE, objects are trimmed exclusively, only retaining those strictly within the bounding polygon; otherwise all objects which partly extend within the bounding polygon are retained.
A trimmed version of dat, reduced only to those components
lying within the bounding polygon.