isochrone: Generate Isochrones

Description Usage Arguments Details Value Examples

View source: R/valhalla.R

Description

An isochrone, also known as a service area, is a polygon that shows the area reachable from a starting point by traveling along a road network for a certain distance or time. This function provides an interface to the Valhalla routing engine's isochrone API. It lets you provide a starting point's latitude and longitude, a distance or time metric, and a vector of distances/times, and if it's successful it returns an sf-class tibble of polygons.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
isochrone(
  from,
  costing = "pedestrian",
  contours = c(5, 10, 15),
  metric = "min",
  min_road_class = "residential",
  minimum_reachability = 500,
  hostname = "localhost",
  port = 8002
)

Arguments

from

A tibble containing one origin location in columns named lat and lon.

costing

The travel costing method: at present "auto", "bicycle", and "pedestrian" are supported.

contours

A numeric vector of values at which to produce the isochrones.

metric

Distance or time. Accepts parameters "min" and "km".

min_road_class

The minimum road classification Valhalla will consider. Defaults to residential.

minimum_reachability

The minimum number of nodes a candidate network needs to have before it is included.

hostname

Hostname or IP address of your Valhalla instance. Defaults to "localhost".

port

The port your Valhalla instance is monitoring. Defaults to 8002.

Details

More more information, please see Valhalla's API documentation:

Value

An sf/tibble object containing isochrone polygons.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
library(valhallr)
# set up our departure point: the University of Ottawa
from <- test_data("uottawa")

# generate a set of isochrones for travel by bicycle
i <- valhallr::isochrone(from, costing = "bicycle")

# map the isochrones
map_isochrone(i)

## End(Not run)

valhallr documentation built on March 9, 2021, 9:09 a.m.