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

osrmIsometric

Get Polygons of Isodistances


Description

Based on osrmTable, this function buids polygons of isometric road distances.

Usage

osrmIsometric(
  loc,
  breaks = seq(from = 0, to = 10000, length.out = 4),
  exclude = NULL,
  res = 30,
  returnclass = "sp",
  osrm.server = getOption("osrm.server"),
  osrm.profile = getOption("osrm.profile")
)

Arguments

loc

a numeric vector of longitude and latitude (WGS84), an sf object, a SpatialPointsDataFrame or a SpatialPolygonsDataFrame of the origine point.

breaks

a numeric vector of isometric values (in meters).

exclude

pass an optional "exclude" request option to the OSRM API.

res

number of points used to compute isochrones, one side of the square grid, the total number of points will be res*res.

returnclass

class of the returned polygons. Either "sp" of "sf".

osrm.server

the base URL of the routing server. getOption("osrm.server") by default.

osrm.profile

the routing profile to use, e.g. "car", "bike" or "foot" (when using the routing.openstreetmap.de test server). getOption("osrm.profile") by default.

Value

A SpatialPolygonsDateFrame or an sf MULTIPOLYGON of isochrones is returned. The data frame of the output contains four fields: id (id of each polygon), min and max (minimum and maximum breaks of the polygon), center (central values of classes).

See Also

Examples

## Not run: 
library(sf)
data("berlin")
# Get isochones with lon/lat coordinates
iso <- osrmIsometric(loc = c(13.43,52.47), breaks = c(0,100,200, 500, 1000),
                     returnclass="sf")
plot(st_geometry(iso))

## End(Not run)

osrm

Interface Between R and the OpenStreetMap-Based Routing Service OSRM

v3.4.1
GPL-3
Authors
Timothée Giraud [cre, aut] (<https://orcid.org/0000-0002-1932-3323>), Robin Cura [ctb], Matthieu Viry [ctb], Robin Lovelace [ctb] (<https://orcid.org/0000-0001-5679-6536>)
Initial release

We don't support your browser anymore

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