osm_polygons | R Documentation |
osm_polygons
from an osmdata objectIf id
is of a point object, osm_polygons
will return all
polygons containing that point. If id
is of a line or polygon object,
osm_polygons
will return all polygons which intersect the given line
or polygon.
osm_polygons(dat, id)
dat |
An object of class osmdata |
id |
OSM identification of one or more objects for which polygons are to be extracted |
An sf Simple Features Collection of polygons
Other search:
osm_lines()
,
osm_multilines()
,
osm_multipolygons()
,
osm_points()
## Not run:
# Extract polygons which intersect Conway Street in London
dat <- opq ("Marylebone London") %>%
add_osm_feature (key = "highway") %>%
osmdata_sf ()
conway <- which (dat$osm_lines$name == "Conway Street")
id <- rownames (dat$osm_lines [conway, ])
osm_polygons (dat, id)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.