Looped calculation of duration and distance matrices between all sources and targets (multicore)
calc_odm_multicore(profile_string, sources, targets, max_chunk_size, ors_url)
profile_string | Route profile |
---|---|
sources | sf object of geometry type point containing the sources with coordinates in separate x, y columns |
targets | data.frame containing the targets with coordinates in separate x, y columns |
max_chunk_size | integer value defining the maximum number of source to target connections to be processed per loop |
ors_url | url of the openrouteservice server to be used for processing |
odm-object of type list encompassing duration and distance matrices and the source and target locations
calc_odm()
for sequential odm_object creation with one core
if (FALSE) { handlers(global = TRUE) handlers("progress") data(testdata) sources <- testdata$od_result$sources targets <- testdata$od_result$targets # The testdata dataset is too small to generate time benefits out of using # parallel processing. It should be applied to larger datasets max_chunk_size <- 200 # depends on the config of the OpenRouteService server registerDoFuture() plan(multisession, gc = TRUE) ors_url <- "SERVER URL" res <- calc_odm_multicore(profile_string = "foot-walking", sources = sources, targets = targets, max_chunk_size = 200, ors_url = ors_url) }