Looped calculation of duration and distance matrices between all sources and targets (single core)
calc_odm(profile_string, source_locations, target_locations, max_chunk_size)
| profile_string | Route profile |
|---|---|
| source_locations | sf object of geometry type point containing the sources with coordinates in separate x, y columns |
| target_locations | 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 |
odm-object of type list encompassing duration and distance matrices and the source and target locations
calc_odm_multicore() for odm_object creation using multiple
cores
if (FALSE) { data(testdata) options(openrouteservice.url = "SERVER URL") sources <- testdata$od_result$sources targets <- testdata$od_result$targets max_chunk_size <- 200 # depends on the config of the OpenRouteService server res <- calc_odm( profile_string = "foot-walking", source_locations = sources, target_locations = targets, max_chunk_size = max_chunk_size ) }