otp_evaluate_surface: Evaluates an existing travel time surface (OTPv1 only).

View source: R/otp_evaluate_surface.R

otp_evaluate_surfaceR Documentation

Evaluates an existing travel time surface (OTPv1 only).

Description

Evaluates an existing travel time surface. Using a pointset from a specified CSV file, the travel time to each point is obtained from the specified surface. Accessibility indicators are then generated for one or more 'opportunity' columns in the pointset. For example, you might have the number of jobs available at each location, or the number of hospital beds.

Usage

otp_evaluate_surface(otpcon, surfaceId, pointset, detail = FALSE)

Arguments

otpcon

An OTP connection object produced by otp_connect.

surfaceId

Integer, the id number of an existing surface created using otp_create_surface().

pointset

Character string, the name of a pointset known to OTP. A pointset is contained in a CSV file present in the pointset directory location passed to OTP at startup. The name of the pointset is the name of the file (without extension).

detail

logical, whether the travel time from the surface origin to each location in the pointset should be returned. Default is FALSE.

Details

This function requires OTP to have been started with the --analyst switch and the --pointset parameter set to the path of a directory containing the pointset file(s).

Value

Assuming no error, returns a list containing 4 or more elements:

  • errorId Will be "OK" if no error condition.

  • surfaceId The id of the surface that was evaluated.

  • One or more dataframes for each of the 'opportunity' columns in the pointset CSV file. Each dataframe contains four columns:

    • minutes. The time from the surface origin in one-minute increments.

    • counts. The number of the opportunity locations reached within each minute interval.

    • sum. The sum of the opportunities at each of the locations reached within each minute interval.

    • cumsums. A cumulative sum of the opportunities reached.

  • If detail was set to TRUE then an additional dataframe containing the time taken (in seconds) to reach each point in the pointset CSV file. If a point was not reachable the time will be recorded as NA.

  • query The URL that was submitted to the OTP API.

If there is an error, a list containing 3 elements is returned:

  • errorId The id code of the error.

  • errorMessage The error message.

  • query The URL that was submitted to the OTP API.

Examples

## Not run: 
otp_evaluate_surface(otpcon, surfaceId = 0, pointset = "jobs", detail = TRUE)

## End(Not run)

marcusyoung/otpr documentation built on Aug. 22, 2022, 8:08 a.m.