Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

osm_multilines

Extract all osm_multilines from an osmdata object


Description

id must be of an osm_points or osm_lines object (and can not be the id of an osm_polygons object because multilines by definition contain no polygons. osm_multilines returns any multiline object(s) which contain the object specified by id.

Usage

osm_multilines(dat, id)

Arguments

dat

An object of class osmdata

id

OSM identification of one of more objects for which multilines are to be extracted

Value

An sf Simple Features Collection of multilines

See Also

Examples

## Not run: 
dat <- opq ("London UK") %>%
    add_osm_feature (key = "name", value = "Thames", exact = FALSE) %>%
    osmdata_sf ()
# Get ids of lines called "The Thames":
id <- rownames (dat$osm_lines [which (dat$osm_lines$name == "The Thames"), ])
# and find all multilinestring objects which include those lines:
osm_multilines (dat, id)
# Now note that
nrow (dat$osm_multilines) # = 24 multiline objects
nrow (osm_multilines (dat, id)) # = 1 - the recursive search selects the
# single multiline containing "The Thames"

## End(Not run)

osmdata

Import 'OpenStreetMap' Data as Simple Features or Spatial Objects

v0.1.10
GPL-3
Authors
Mark Padgham [aut, cre], Bob Rudis [aut], Robin Lovelace [aut], Maëlle Salmon [aut], Andrew Smith [ctb], James Smith [ctb], Andrea Gilardi [ctb], Enrico Spinielli [ctb], Anthony North [ctb], Martin Machyna [ctb], Marcin Kalicinski [ctb, cph] (Author of included RapidXML code)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.