travel time from google maps API does not vary with time of day

761 Views Asked by At

I used gmapdistance to calculate travel time between two points in New York at different times. Can someone please tell me why is the travel time same and is not varying with time of day?

library(gmapsdistance)
library(lubridate)

# key is set

temp1 = gmapsdistance(
  origin = "40.75905289665592+-73.97693625311344",
  destination = "40.76264792279165+-73.99683999171252",
  mode = "driving",
  key = key,
  departure = as.numeric(ymd_hms("2021-09-11 15:00:00"))
)
temp1$Time


temp2 = gmapsdistance(
  origin = "40.75905289665592+-73.97693625311344",
  destination = "40.76264792279165+-73.99683999171252",
  mode = "driving",
  key = key,
  departure = as.numeric(ymd_hms("2021-09-11 19:00:00"))
)
temp2$Time

temp3 = gmapsdistance(
  origin = "40.75905289665592+-73.97693625311344",
  destination = "40.76264792279165+-73.99683999171252",
  mode = "driving",
  key = key,
  departure = as.numeric(ymd_hms("2021-09-11 23:00:00"))
)
temp3$Time
0

There are 0 best solutions below