Skip to content

Commit f2b7fc7

Browse files
committed
also write 'intervals' to temp file in 2nd pass of gtfs time calculation
1 parent 482793f commit f2b7fc7

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: m4ra
22
Title: Many-to-Many Multi-Modal Routing Aggregator
3-
Version: 0.1.1.055
3+
Version: 0.1.1.056
44
Authors@R:
55
person(given = "Mark",
66
family = "Padgham",

R/gtfs.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@ gtfs_next_start_times <- function (gtfs, stops, start_times, start_interval) {
194194
c (stops [i], start_times [i] + c (0, start_interval))
195195
})
196196

197+
tdir <- fs::dir_ls (fs::path_temp (), regexp = "gtfstemp")
198+
if (length (tdir) > 0L) {
199+
checkmate::assert_character (tdir, len = 1L)
200+
checkmate::assert_directory_exists (tdir)
201+
}
202+
197203
# gtfsrouter::traveltimes default params:
198204
minimise_transfers <- FALSE
199205
max_traveltime <- 60 * 60
@@ -226,6 +232,13 @@ gtfs_next_start_times <- function (gtfs, stops, start_times, start_interval) {
226232
stns <- array (NA_integer_, dim = c (nrow (gtfs$stops) + 1L, 3L))
227233
}
228234

235+
if (length (tdir) > 0L) {
236+
f <- fs::path (tdir, s)
237+
if (fs::file_exists (f)) {
238+
write ("-intervals", file = f, append = TRUE)
239+
}
240+
}
241+
229242
return (stns [-1, ]) # 3 cols: start_time, duration, ntransfers
230243
}, mc.cores = num_cores)
231244

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"codeRepository": "https://github.com/UrbanAnalyst/m4ra",
88
"issueTracker": "https://github.com/UrbanAnalyst/m4ra/issues",
99
"license": "https://spdx.org/licenses/GPL-3.0",
10-
"version": "0.1.1.055",
10+
"version": "0.1.1.056",
1111
"programmingLanguage": {
1212
"@type": "ComputerLanguage",
1313
"name": "R",

0 commit comments

Comments
 (0)