Audit_power28
Audit_power28

Reputation: 11

network.dat file missing from r5r setup: is Java 21 integration to blame (a bug) or have I lost it?

With the recent update for r5r in April 2024 requiring users to have Java Development Kit 21 to run the r5r setup() command, it seems to me like there are now issues running the r5r package for a simple application.

I have run a very simple setup in a folder with the GTFS zip folder named "transitfeeds_GTFS.zip" in line with what I understand the necessary naming convention to be (namely, ending with GTFS.zip) and a simple geofabrik osm.pbf file. I have foregone the Elevation Tif that's optional. When running r5_setup() I just specify the folder containing those two files, and the initialization runs and ends with a line that the network.dat file has been successfully completed. However, this file does not end up anywhere that I can locate. Neither does the network_settings.json file for the same reason. When I try to create a travel_time_matrix, I end up with an incredibly vague java error that I cannot find reference to anywhere else on the internet other than with other bugs identified at least 3 years ago. I figure this is on account of the network.dat files not being produced and not being referenceable.

data_path <- file.path("C://Users//Admin//Documents//RStudio//Spatial Analysis//Research Project")
r5r_core2 <- setup_r5(data_path = data_path)

Unfortunately, the code is that simple as described in the paragraph above, not too much to share.

With so many examples of this r5r package online, I haven't been able to find a single one from after the Java change in late 2023. Every example explicitly mentions using a specific version of Java 11 with warnings about errors if another version is used. In order to follow these examples to see if it is indeed an issue with either java or the package, I would have to download earlier versions of R, RStudio, and the r5r package to maybe get this to work, and early attempts at this only caused further issues for me because I didn't have the exact right combinations of all three.

Furthermore, earlier on in my analysis, I was unaware of the naming conventions for the GTFS file, and had "gtfs" somewhere in the middle of my file name. That r5_setup() ran just fine but was of course missing a large portion of the data in the network I believe. Either way, even if it did include the necessary elements, it did not accurately map the network as further results of travel_time_matrix were problematic. I guess the helpful thing here is that the r5_setup() has proven capable of producing network.dat files on my computer, but only when I was using wrong naming conventions for GTFS files. In other words, when transit was not taken into account at all.

Anyone run into this?

Upvotes: 1

Views: 122

Answers (1)

nacohen
nacohen

Reputation: 1

I was losing my mind over this for days! It looks like there is a bug where if the osm.pbf is too big (too many nodes) to successfully build a network, it doesn't give an error message -- it just returns "the network.dat file has been successfully created" anyway.

When I ran the same code with an osm.pbf with few enough nodes (in my case I clipped my state OSM to a bounding box around one city), the network.dat file showed up in my working directory.

Upvotes: 0

Related Questions