otp_connect: Set up and confirm a connection to an OTP instance.

Description Usage Arguments Value Examples

View source: R/otp-connect.R

Description

Defines the parameters required to connect to a router on an OTP instance and, if required, confirms that the instance and router are queryable.

Usage

1
2
otp_connect(hostname = "localhost", router = "default", port = 8080,
  ssl = FALSE, check = TRUE)

Arguments

hostname

A string, e.g. "ec2-34-217-73-26.us-west-2.compute.amazonaws.com". Optional, default is "localhost".

router

A string, e.g. "UK2018". Optional, default is "default".

port

A positive integer. Optional, default is 8080.

ssl

Logical, indicates whether to use https. Optional, default is FALSE.

check

Logical. If TRUE connection object is only returned if OTP instance and router are confirmed reachable. Optional, default is TRUE.

Value

Returns an S3 object of class otpconnect. If check is TRUE and the router is not reachable the object is not returned.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
otpcon <- otp_connect()
otpcon <- otp_connect(router = "UK2018",
                      ssl = TRUE)
otpcon <- otp_connect(hostname = "ec2.us-west-2.compute.amazonaws.com",
                      router = "UK2018",
                      port = 8888,
                      ssl = TRUE)

## End(Not run)

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