batch_multi: Batch routing for multiple plans and large datasets

View source: R/batch_multi.R

batch_multiR Documentation

Batch routing for multiple plans and large datasets

Description

Batch routing for multiple plans and large datasets

Usage

batch_multi(
  desire_lines,
  plans = c("fastest", "balanced"),
  nrow_batch = 10000,
  temp_folder = tempdir(),
  batch_ids = NULL,
  ...
)

Arguments

desire_lines

Input desire lines

plans

Plans, e.g. fastest

nrow_batch

How many rows per batch?

temp_folder

path to folder

batch_ids

NULL?

...

Arguments passed to batch

Value

A list of routes.

Examples

if(FALSE) {
od_df = readr::read_csv("https://github.com/nptscot/npt/raw/main/data-raw/od_subset.csv")
zones = sf::read_sf("https://github.com/nptscot/npt/raw/main/data-raw/zones_edinburgh.geojson")
desire_lines = od::od_to_sf(od_df, zones)
desire_lines = desire_lines[1:100, ]
p = c("fastest", "quietest")
routes_multi = batch_multi(desire_lines, plans = p, nrow_batch = 26, delete_job = FALSE)
names(routes_multi)
plot(routes_multi$fastest$geometry)
plot(routes_multi$quietest$geometry)
ids = list(
  fastest = 4059:(4059+3),
  quietest = 4063:(4063+3)
)
r_ids = batch_multi(desire_lines, plans = p, nrow_batch = 26, delete_job = FALSE, batch_ids = ids)
}

cyclestreets documentation built on Sept. 11, 2024, 7:49 p.m.