osm_poly2line | R Documentation |
Street networks downloaded with add_osm_object(key = "highway")
will
store any circular highways in osm_polygons
. this function combines
those with the osm_lines
component to yield a single sf
data.frame
of all highways, whether polygonal or not.
osm_poly2line(osmdat)
osmdat |
An osmdata object. |
Modified version of same object with all osm_polygons
objects merged into osm_lines
.
The osm_polygons
field is retained, with those features also
repeated as LINESTRING
objects in osm_lines
.
Other transform:
osm_elevation()
,
trim_osmdata()
,
unique_osmdata()
,
unname_osmdata_sf()
## Not run:
dat <- opq ("colchester uk") %>%
add_osm_feature (key = "highway") %>%
osmdata_sf ()
# colchester has lots of roundabouts, and these are stored in 'osm_polygons'
# rather than 'osm_lines'. The former can be merged with the latter by:
dat2 <- osm_poly2line (dat)
# 'dat2' will have more lines than 'dat', but the same number of polygons
# (they are left unchanged.)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.