Learn R Programming

rcrisp (version 0.3.1)

get_osm_streets: Get OpenStreetMap streets

Description

Get OpenStreetMap streets

Usage

get_osm_streets(aoi, crs = NULL, highway_values = NULL, force_download = FALSE)

Value

An object of class sf::sfc_LINESTRING

Arguments

aoi

Area of interest as sf object or bbox. Required, no default.

crs

A numeric vector of length one with the EPSG code of the CRS

highway_values

A character vector with the highway values to retrieve. If left NULL, the function retrieves the following values: "motorway", "trunk", "primary", "secondary", "tertiary"

force_download

Download data even if cached data is available

Examples

Run this code
if (FALSE) { # interactive()
# Set parameters
bb <- get_osm_bb("Bucharest")
crs <- 31600  # National projected CRS

# Get streets with default values
get_osm_streets(aoi = bb, crs = crs)

# Specify street categories to be retrieved
get_osm_streets(aoi = bb, crs = crs, highway_values = "primary")

# Ensure that data is not retrieved from cache
get_osm_streets(aoi = bb, crs = crs, force_download = FALSE)
}

Run the code above in your browser using DataLab