Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uproute_matrix() does not accept all row dimensions as input #31
Comments
|
Fixed: library(sf)
#> Linking to GEOS 3.7.2, GDAL 2.4.2, PROJ 5.2.0
n <- 15*2
l <- n*n
sf <-
data.frame(
idx = seq(1, n),
lng = runif(n, 7.5, 8.5),
lat = runif(n, 47.25, 47.75)
) %>%
st_as_sf(coords = c("lng", "lat")) %>%
st_set_crs(4326)
head(route_matrix(sf))
#> origIndex destIndex departure arrival distance
#> 1 1 1 2020-01-18 17:41:41 2020-01-18 17:41:41 0
#> 2 1 2 2020-01-18 17:41:41 2020-01-18 18:39:04 70891
#> 3 1 3 2020-01-18 17:41:41 2020-01-18 18:42:06 90579
#> 4 1 4 2020-01-18 17:41:41 2020-01-18 18:13:31 30107
#> 5 1 5 2020-01-18 17:41:41 2020-01-18 18:23:42 54477
#> 6 1 6 2020-01-18 17:41:41 2020-01-18 18:39:41 57308
#> travelTime costFactor
#> 1 0 1
#> 2 3443 3503
#> 3 3625 3725
#> 4 1910 1970
#> 5 2521 2581
#> 6 3480 3520 |
The function
route_matrix()does not accept entries fororiginanddestinationwith a number of rows that are divisible by the maximum permitted dimensions (M:N = 15:100) of the HERE Traffic API’s route matrix end point.Construct a dummy data set and test:
Session info