extract_osm_objects | R Documentation |
Downloads OSM XML objects and converts to sp
objects
(SpatialPointsDataFrame
, SpatialLinesDataFrame
, or
SpatialPolygonsDataFrame
).
extract_osm_objects(
bbox,
key = NULL,
value,
extra_pairs,
return_type,
sf = TRUE,
geom_only = FALSE,
quiet = FALSE
)
bbox |
the bounding box within which all key-value objects should be downloaded. A 2-by-2 matrix of 4 elements with columns of min and max values, and rows of x and y values. |
key |
OSM key to search for. Useful keys include |
value |
OSM value to match to key. If |
extra_pairs |
A list of additional |
return_type |
If specified, force return of spatial ( |
sf |
If |
geom_only |
If |
quiet |
If |
Either a SpatialPointsDataFrame
, SpatialLinesDataFrame
,
or SpatialPolygonsDataFrame
.
add_osm_objects
.
Other data-extraction:
connect_highways()
,
get_bbox()
## Not run:
bbox <- get_bbox (c (-0.13, 51.50, -0.11, 51.52))
dat_B <- extract_osm_objects (key = "building", bbox = bbox)
dat_H <- extract_osm_objects (key = "highway", bbox = bbox)
dat_BR <- extract_osm_objects (
key = "building",
value = "residential",
bbox = bbox
)
dat_HP <- extract_osm_objects (
key = "highway",
value = "primary",
bbox = bbox
)
dat_HNP <- extract_osm_objects (
key = "highway",
value = "!primary",
bbox = bbox
)
extra_pairs <- c ("name", "Royal.Festival.Hall")
dat <- extract_osm_objects (
key = "building", extra_pairs = extra_pairs,
bbox = bbox
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.