Description Usage Arguments Details Value Examples
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.
1 2 | otp_build_graph(otp = NULL, dir = NULL, memory = 2,
router = "current", analyst = FALSE)
|
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 |
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
Returns and log messages produced by OTP, and will return the message "Graph built" if successful
1 2 3 4 | ## Not run:
log = otp_build_graph(otp = "C:/otp/otp.jar", dir = "C:/data")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.