-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
using jdk 21 and dev r5r
- Loading branch information
Showing
2 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# same as heat-prep_car.R bur with linestrings from routes | ||
|
||
library(dplyr) | ||
library(sf) | ||
options(java.parameters = '-Xmx110G') | ||
library(r5r) | ||
r5r_lts_intermodalityALL = setup_r5(data_path = "r5r/allmodes2/", elevation = "MINETTI") #to create new, delete network.dat in the folder. otherwise just load it | ||
|
||
|
||
routes_r5r_100jit_car_GEO = detailed_itineraries( | ||
r5r_lts_intermodalityALL, | ||
origins = od_jittered_100filter_OR, | ||
destinations = od_jittered_100filter_DE, | ||
mode = "CAR", #only car | ||
mode_egress = "WALK", | ||
departure_datetime = departure_datetime, | ||
max_trip_duration = 120L, #in minutes | ||
shortest_path = TRUE, #FALSE? fastest or multiple alternatives? | ||
all_to_all = FALSE, | ||
n_threads = Inf, | ||
verbose = FALSE, | ||
progress = TRUE, | ||
drop_geometry = FALSE | ||
# output_dir = "r5r/resultstemp/" | ||
) | ||
|
||
|
||
routes_r5r_100jit_car_GEO = routes_r5r_100jit_car_GEO %>% mutate(id = as.integer(from_id)) %>% | ||
select(id, total_duration, total_distance, segment, mode, segment_duration, distance, geometry) %>% | ||
left_join(od_jittered_100filter %>% st_drop_geometry(), by="id") | ||
|
||
names(routes_r5r_100jit_car_GEO)[7] = "distance" | ||
names(routes_r5r_100jit_car_GEO)[18] = "eucl_distance" | ||
|
||
saveRDS(routes_r5r_100jit_car_GEO, "routes_r5r_100jit_car_GEO.Rds") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
# system.file("jar", package = "r5r") | ||
# tools::R_user_dir("r5r", which = "cache") | ||
|
||
r5r::download_r5(force_update = TRUE) | ||
r5r::r5r_sitrep() | ||
tools::R_user_dir("r5r", which = "cache") | ||
|
||
# sudo Rscript -e "r5r::download_r5(force_update = TRUE)" | ||
|
||
options(java.parameters = '-Xmx32G') | ||
options(java.parameters = '-Xmx120G') | ||
library(r5r) | ||
data_path <- system.file("extdata/poa", package = "r5r") | ||
r5r_core <- r5r::setup_r5(data_path = data_path) |