ipeaGIT / r5r

https://ipeagit.github.io/r5r/
Other
180 stars 29 forks source link

Error in fareto debug #403

Open rafapereirabr opened 2 weeks ago

rafapereirabr commented 2 weeks ago

@mattwigway , you pushed to the repo the function fareto_debug() some time ago. Only now I've found some time to have a look at it and to add some documentation to the function. However, I cannot create a simple reproducible example. See the error below. Could you give me a hand? perhaps I'm missing something here.

library(r5r)

# build transport network
data_path <- system.file("extdata/poa", package = "r5r")
r5r_core <- setup_r5(data_path = data_path, overwrite = T)

# load origin/destination points
points <- read.csv(file.path(data_path, "poa_hexgrid.csv"))[1:5,]

# load fare structure object
fare_structure_path <- system.file("extdata/poa/fares/fares_poa.zip", package = "r5r")

fare_structure <- read_fare_structure(fare_structure_path)

departure_datetime <- as.POSIXct(
 "13-05-2019 14:00:00",
 format = "%d-%m-%Y %H:%M:%S"
)

# fareto debug 
fd <- fareto_debug(
  r5r_core,
  origins = points[1,],
  destinations = points[10,],
  mode = c("WALK", "TRANSIT"),
  departure_datetime = departure_datetime,
  fare_structure = fare_structure
  )

Error in FUN(X[[i]], ...) : java.lang.NullPointerException: Cannot read field "value" because "original" is null

mattwigway commented 2 weeks ago

Yes, thanks for flagging this. I'm swamped up through mid next week but will look after that. Feel free to bug me if I don't.

rafapereirabr commented 2 weeks ago

Thanks! In the meantime, I moved it to a separate branch.