Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with setup_r5() #10

Closed
dhersz opened this issue Aug 15, 2020 · 7 comments
Closed

Issues with setup_r5() #10

dhersz opened this issue Aug 15, 2020 · 7 comments

Comments

@dhersz
Copy link
Member

dhersz commented Aug 15, 2020

I noticed that after the creation of R5 core some new files were created in inst/extdata (when running it with the sample data). These are: network.dat, poa_osm.pbf.mapdb and poa_osm.pbf.mapdb.p. Any ideas what that might be?

Also, when running setup_r5 with a .pbf file but no gtfs an error arises (I just copied the pbf file to ~ in this example):

> setup_r5("~")
Using cached version from C:/Users/Usuario/Documents/R/win-library/4.0/r5r/jar/r5r_v4.9.0.jar
12 [main] INFO com.conveyal.r5.transit.TransportNetwork - File '~\build-config.json' is not present. Using default configuration.
 Error in rJava::.jnew("com.conveyal.r5.R5RCore", data_path) : 
  java.lang.NullPointerException 

Edit: Actually, I tried creating a test folder inside ~ with the exact same files as inst/extdata" and run setup_r5("~/test") and I get the same error message as above.

@dhersz
Copy link
Member Author

dhersz commented Aug 15, 2020

The network.dat is the graph, I suppose, but not sure what the others are.

@rafapereirabr
Copy link
Member

I' not entirely sure why R5 create these other .pbf.mapdb.p, though this seems to be a data base that R5 uses internally. In any case, I don't see why this should be a concern for the moment, right?

Regarding the other questions, update the lastest version of r5r and let me know if the problem persists. Rigth now, the setup_r5 function should be able to build a network if only a OSM.pbf file is provided with no GTFS. So, the GTFS file is optional so to speak, but it cannot create a network without an OSM.pbf file.

@mvpsaraiva
Copy link
Collaborator

Apparently, the pbf.mapdb and pbf.mapdb.p files are required by R5. I tried deleting them, but R5 created them again the next time I ran setup. I've added them to .gitignore.

@dhersz
Copy link
Member Author

dhersz commented Aug 15, 2020

The problem persists. Here's a reproducible code, can you check if you get the same error?

dir.create("~/test_r5r")

files_path <- system.file("extdata", package = "r5r")

file.copy(
  from = paste0(files_path, "/", list.files(files_path)), 
  to = "~/test_r5r"
)

setup_r5("~/test_r5r")

@mvpsaraiva
Copy link
Collaborator

In my test, "~/test_r5r" is not recognised as a correct path. I don't know if this is an R or Java issue. Changing the path to "/home/marcus/test_r5r" worked.

I've found the function path.expand() that does what we need.

@mvpsaraiva
Copy link
Collaborator

I believe it's working now.
ce42bdb

@dhersz
Copy link
Member Author

dhersz commented Aug 15, 2020

Works alright for me now!

@dhersz dhersz closed this as completed Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants