time_filter_fast_proto {traveltimeR}R Documentation

Time Filter (Fast) with Protobuf

Description

The Travel Time Matrix (Fast) endpoint is available with even higher performance through a version using Protocol Buffers. The endpoint takes as inputs a single origin location, multiple destination locations, a mode of transport, and a maximum travel time. The endpoint returns the travel times to each destination location, so long as it is within the maximum travel time.

Usage

time_filter_fast_proto(
  departureLat,
  departureLng,
  country = c("uk", "ireland"),
  travelTime,
  destinationCoordinates,
  transportation = names(protoTransport),
  useDistance = FALSE
)

Arguments

departureLat

origin latitude

departureLng

origin longitude

country

Origin country. Only UK and Ireland are supported.

travelTime

Maximum journey time (in seconds).

destinationCoordinates

data.frame with pairs of coordinates. Coordinates columns must be named 'lat' and 'lng'

transportation

One of supported transportation methods: 'pt', 'driving+ferry', 'cycling+ferry', 'walking+ferry'.

useDistance

return distance information

Details

See https://docs.traveltime.com/api/start/travel-time-distance-matrix-proto for details

Value

API response parsed as a list and as a raw json

Examples

## Not run: 
time_filter_fast_proto(
departureLat = 51.508930,
departureLng = -0.131387,
destinationCoordinates = data.frame(
  lat = c(51.508824, 51.536067),
  lng = c(-0.167093, -0.153596)
),
transportation = 'driving+ferry',
travelTime = 7200,
country = "uk",
useDistance = FALSE
)

## End(Not run)

[Package traveltimeR version 1.2.1 Index]