[R] [R-pkgs] New package to query the OpenTripPlanner (OTP) API
M@A@Young @end|ng |rom @oton@@c@uk
Tue Apr 9 12:59:55 CEST 2019
A new R package 'otpr' is now available on CRAN. It's a wrapper for the OpenTripPlanner (OTP) API and is primarily aimed at researchers and transport planners who want to use OTP to carry out accessibility studies or generate variables for transport models. The package consists of four main functions:
otp_connect() - defines and tests the connection to an OTP instance.
otp_get_distance() - gets the distance in metres between an origin and destination on the street and/or path network by specified mode.
otp_get_times() - in its simplest use case gets the journey time between an origin and destination by specified mode(s). It can also return more detailed information, breaking down the journey by transit time, walking time, waiting time and the number of transfers.
otp_get_isochrone() - returns one or more travel time isochrones for a location in GeoJSON format. These can be generated either from or to the specified location.
The package currently supports a subset of the parameters that are available for the OTP 'planner' and 'isochrone' API resources. This is based on my experience of using OTP to generate this type of data and to keep the functions relatively simple from the user perspective. For a future release I will be allowing a larger range of parameters to be optionally passed through to the API query, giving greater flexibility but still keeping the external functions simple for users who don't need such detailed control.
For more information, including code examples, take a look at the GitHub repository for the package:
I also have an OTP intermediate level tutorial - 'creating and querying your own multi-modal route planner' - which incorporates use of the package:
I'd welcome any feedback as well as suggestions for future development.
Dr Marcus Young
Transportation Research Group
University of Southampton
R-packages mailing list
R-packages using r-project.org
More information about the R-help