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

otp_isochrone

Get the Isochrones from a location


Description

Get the Isochrones from a location

Usage

otp_isochrone(
  otpcon = NA,
  fromPlace = NA,
  fromID = NULL,
  mode = "TRANSIT",
  date_time = Sys.time(),
  arriveBy = FALSE,
  maxWalkDistance = 1000,
  routingOptions = NULL,
  cutoffSec = c(600, 1200, 1800, 2400, 3000, 3600),
  ncores = 1,
  timezone = otpcon$timezone
)

Arguments

otpcon

OTP connection object produced by otp_connect()

fromPlace

Numeric vector, Longitude/Latitude pair, e.g. 'c(-0.134649,51.529258)', or 2 column matrix of Longitude/Latitude pairs, or sf data frame of POINTS

fromID

character vector same length as fromPlace

mode

character vector of one or more modes of travel valid values TRANSIT, WALK, BICYCLE, CAR, BUS, RAIL, default CAR. Not all combinations are valid e.g. c("WALK","BUS") is valid but c("WALK","CAR") is not.

date_time

POSIXct, a date and time, defaults to current date and time

arriveBy

Logical, Whether the trip should depart or arrive at the specified date and time, default FALSE

maxWalkDistance

maximum distance to walk in metres

routingOptions

named list passed to OTP see 'otp_routing_options()'

cutoffSec

Numeric vector, number of seconds to define the break points of each Isochrone

ncores

number of cores to use in parallel processing

timezone

character, timezone to use, default from otpcon

Details

Isochrones are maps of equal travel time, for a given location a map is produced showing how long it takes to reach each location.

Value

Returns a SF data.frame of POLYGONs

See Also

Examples

## Not run: 
isochrone1 <- otp_isochrone(otpcon, fromPlace = c(-0.1346, 51.5292))
isochrone2 <- otp_isochrone(otpcon,
  fromPlace = c(-0.1346, 51.5292),
  mode = c("WALK", "TRANSIT"), cutoffSec = c(600, 1200, 1800)
)

## End(Not run)

opentripplanner

Setup and connect to 'OpenTripPlanner'

v0.3.1
GPL-3
Authors
Malcolm Morgan [aut, cre] (<https://orcid.org/0000-0002-9488-9183>), Marcus Young [aut] (<https://orcid.org/0000-0003-4627-1116>), Robin Lovelace [aut] (<https://orcid.org/0000-0001-5679-6536>), Layik Hama [ctb] (<https://orcid.org/0000-0003-1912-4890>)
Initial release

We don't support your browser anymore

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