Skip to content

Commit

Permalink
fix #116
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Feb 1, 2024
1 parent d6d0abf commit a4a4f10
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: gtfsrouter
Title: Routing with 'GTFS' (General Transit Feed Specification) Data
Version: 0.1.2.004
Version: 0.1.2.005
Authors@R: c(
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre")),
person("Marcin", "Stepniak", , "[email protected]", role = "aut",
Expand Down
4 changes: 3 additions & 1 deletion R/traveltimes.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ gtfs_traveltimes <- function (gtfs,

# C++ matrix is 1-indexed, so discard first row (= 0)
stns <- stns [-1, ]
index <- which (stns [, 1] < 0 | stns [, 1] == .Machine$integer.max)
stns [index, ] <- NA
stns <- data.frame (
start_time = stns [, 1],
duration = stns [, 2],
Expand All @@ -114,7 +116,7 @@ gtfs_traveltimes <- function (gtfs,
stop_lat = gtfs$stops$stop_lat,
stringsAsFactors = FALSE
)
stns <- stns [which (stns$duration < .Machine$integer.max), ]
stns <- stns [which (!is.na (stns$start_time)), ]
if (nrow (stns) > 0) {
stns$start_time <- format_time (stns$start_time)
stns$duration <- format_time (stns$duration)
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"codeRepository": "https://github.com/UrbanAnalyst/gtfsrouter",
"issueTracker": "https://github.com/UrbanAnalyst/gtfsrouter/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.1.2.004",
"version": "0.1.2.005",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit a4a4f10

Please sign in to comment.