otp_build_graph: Build an OTP Graph

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 builds a OTP graph from the Open Street Map and other files.

Usage

1
2
otp_build_graph(otp = NULL, dir = NULL, memory = 2,
  router = "current", analyst = FALSE)

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 OTP in GB, default is 2

router

A character string for the name of the router, must match with contents of dir, default "current"

analyst

Logical, should analyst feature be built, default FALSE

Details

The OTP .jar file can be downloaded from https://repo1.maven.org/maven2/org/opentripplanner/otp/

To build an OTP graph requires 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 osm.pbf - Required, pbf file containing the Open Street Map router-config.json - Required, json file containing configuration settings for OTP gtfs.zip - Optional, and number of GTFS files with transit timetables terrain.tif - Optional, GeoTiff image of terrain map

The function will accept any file name for the .jar file, but it must be the only .jar file in that directory OTP can support multiple routers (e.g. different regions), each router must have its own sub-directory in the graphs directory

Value

Returns and log messages produced by OTP, and will return the message "Graph built" if successful

Examples

1
2
3
4
## Not run: 
log = otp_build_graph(otp = "C:/otp/otp.jar", dir = "C:/data")

## End(Not run)

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