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

Accesibility Result same for every mode and hour of the day #376

Closed
JideDanalyst opened this issue Mar 7, 2024 · 20 comments
Closed

Accesibility Result same for every mode and hour of the day #376

JideDanalyst opened this issue Mar 7, 2024 · 20 comments

Comments

@JideDanalyst
Copy link

Hello @rafapereirabr Thanks for the other time on the accessibility exercise. In calculating accessibility, I followed the steps you outlined, which included merging the accessibility data with the study area boundary file with geometry, and then plotting an isochrone map to display accessible jobs based on cutoff times. Specifically, I analyzed accessibility on a weekday at 9:00 AM using two different travel modes: walking and taking the bus.

Despite changing the mode of transportation and analyzing different time slots (9:00 AM and 6:00 PM), the accessibility calculations and resultant maps remain identical. Based on my understanding, and as suggested in your book, variations in mode and time should yield different results. Could you please shed some light on this issue? Is it possible that I have overlooked a crucial step, or is it expected that the results remain consistent despite these changes? Your expert insights would be precious to me.
Thank you for your time and assistance.

Codes:
library(r5r)
library(tidyverse)
library(sf)
library(data.table)
library(ggplot2)
library(mapview)
library(rJava)

options(java.parameters = "-Xmx16G")
path = "C:\Users\JUMIA-4237\Desktop\U_clean"
r5r_core <- setup_r5(data_path = path)
od_zones1 <- st_read(file.path(path,"Zone_3.gpkg"))
od_zones1 %>% mapview()
od_zones <- st_read(file.path(path,"zone_re.gpkg"))
od_zones %>% mapview()
od_points_sf <- st_read(file.path(path,"od_points_5.gpkg"))
od_points_sf %>% mapview(zcol="Jobs")
names(od_points_sf)
transit <- transit_network_to_sf(r5r_core)
transit$routes %>%
mapview(zcol = "mode")
access_walk_df <- accessibility(r5r_core,
origins = od_zones,
destinations = od_points_sf,
mode = c("BUS","transit"),
opportunities_colname = "Jobs",
departure_datetime = as.POSIXct("23-05-2023 09:00:00", format = "%d-%m-%Y %H:%M:%S"),
cutoffs = c(15, 30, 60, 90),
verbose = FALSE)
image

@rafapereirabr
Copy link
Member

Your map above only shows the result for walking. You're saying that the results for public transport look exactly the same. Correct?

This is likely related to question 6 in our FAQ.

on another point 1, you should run options(java.parameters = "-Xmx16G") before loading r5r with library(r5r)

on another point 2, your maps for 60 and 90 min. show a very clear discontinuity in accessibility levels, with a square shape. I supect that your OSM data does not cover the entire region of interest, which I assume includes all areas colored in blue

@JideDanalyst
Copy link
Author

the result for walking and public transport looks thesame that's why I uploaded one.

for the OSM this: transit <- transit_network_to_sf(r5r_core)
transit$routes %>%
mapview(zcol = "mode"). pulls it out from the directory ? Can I download this from Overpass directly or from R. I need a clear approach on this one. Thanks. and how many files will this comprise?

I have chosen the date from the GTFS calenda_data. here is the image.
image

@rafapereirabr
Copy link
Member

ok, it seems you're setting the departure time within the GTFS calendar period.

I would suspect there might me some issues with the quality of the GTFS, but honestly, it could be other things. It is very hard to understand what could be going wrong without the data or a reproducible example. In any case, I'd recommend you run the GTFS validator to check for any issues / probrlems in the GTFS feed. You can do this using the {gtfstools} package.

@JideDanalyst
Copy link
Author

Thanks. I will run and find out what is the issue.
Just to ask.. I have downloaded the OSM_PBF file again from BBBike extract covering reasonable amount of area. This goes directly to my directory right ? while this code calls it in: transit <- transit_network_to_sf(r5r_core)
transit$routes %>%. because it seems that codes calls in a certain network different from what I have in my directory

@rafapereirabr
Copy link
Member

yes, you would need to replace the old OSM data in the directory with the new one, and you also need to delete the network.dat file as well to make sure r5r builds a new network with the new data.

the function transit_network_to_sf(r5r_core) will load the network stored in the r5r_core object. This network is saved locally in the network.dat file.

@JideDanalyst
Copy link
Author

JideDanalyst commented Mar 7, 2024 via email

@JideDanalyst
Copy link
Author

Can I perform the validation on another platform other than R ?

@rafapereirabr
Copy link
Member

probably yes, check the github of the original tool

@JideDanalyst
Copy link
Author

image
this is the result

@JideDanalyst
Copy link
Author

Does this means I need download another file ?

@rafapereirabr
Copy link
Member

it looks like your GTFS has some critical errors. you might need another GTFS or to fix these errors;

@JideDanalyst
Copy link
Author

Thats the problem sir fixing is the issue. I am not familiar with that.
And where do you suggest we download a good quality GTFS for London. Thanks

@rafapereirabr
Copy link
Member

unfortunately, I don't have experience with GTFS feed in the UK. Perhaps Duncan or colleagues at CASA might be able to help.

@JideDanalyst
Copy link
Author

Oh thank you sir. You have been helpful. This is clear now. Cheers!

@JideDanalyst
Copy link
Author

Can I reach him on here ?

@rafapereirabr
Copy link
Member

I'm sure you can find his email.

@JideDanalyst
Copy link
Author

JideDanalyst commented Mar 8, 2024 via email

@rafapereirabr
Copy link
Member

a few comments:

  1. Since you're changing the files used to build the network, perhaps you might to set overwrite = TRUE, to make sure you build a new network instead of just loading the old network to memory: setup_r5(data_path = path, overwrite = TRUE)
  2. Most of these 'error' messages are internal messages from Java we cannot silence in R. They are not 'errors' per se. As you can see, r5r was able to build the network. See the message you get Finished building network.dat at C:\Users\JUMIA-4237\Desktop\Accessiblity File/network.dat>
  3. The real error you're getting is when you run transit_network_to_sf(r5r_core). I haven't seen this error before, and I suspect it is because of your GTFS feed. Have you fixed the errors in the GTFS feed?

Try running st <- street_network_to_sf(r5r_core) to see if it works,

@JideDanalyst
Copy link
Author

JideDanalyst commented Mar 8, 2024 via email

@rafapereirabr
Copy link
Member

So it really is an issue with the GTFS data, not with r5r. I'm sorry I cannot help you much further with that. I'd recommend you look at this paper, which points to where you can find GTFS for London and other cities in the UK.

I'm closing this issue for now since this is not an issue with r5r itself.

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

2 participants