otp_setup: Set up an OTP instance.

Description Usage Arguments Details Value Examples

View source: R/otp-setup.R

Description

OTP is run in Java and requires Java commands to be typed into the command line. The function allows the parameters to be defined in R and automatically passed to Java. This function sets up a local instance of OTP, for remote versions see documentation.

Usage

1
2
otp_setup(otp = NULL, dir = NULL, memory = 2, router = "current",
  port = 8080, securePort = 8081, analyst = FALSE, wait = TRUE)

Arguments

otp

A character string, path to the OTP .jar file

dir

A character string, path to a directory containing the necessary files, see details

memory

A positive integer. Amount of memory to assign to the OTP in GB, default is 2

router

A character vector for the name of the routers, must match with contents of dir, default "current" Only a single router is currently supported

port

A positive integer. Optional, default is 8080.

securePort

A positive integer. Optional, default is 8081.

analyst

Logical. Should the analyst features be loaded? Default FALSE

wait

Logical, Should R wait until OTP has loaded before running next line of code, default TRUE

Details

The function assumes you have run otp_build_graph()

To run an OTP graph must have been created using otp_build_graph and the following files to be in the directory specified by the dir variable.

/graphs - A sub-directory /current - A sub-directory with the name of the OTP router used in 'router' variable graph.obj OTP graph

Value

This function does not return a value to R. If wait is TRUE R will wait until OTP is running (maximum of 5 minutes)

Examples

1
2
3
4
5
## Not run: 
otp_setup(otp = "C:/otp/otp.jar", dir = "C:/data")
otp_setup(otp = "C:/otp/otp.jar", dir = "C:/data", memory = 5, analyst = TRUE)

## End(Not run)

marcusyoung/opentripplanner documentation built on May 20, 2019, 4:42 p.m.