We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The output of transit_network_to_sf() can generate routes with invalid geometries.
transit_network_to_sf()
routes
library(r5r) library(ggplot2) library(sf) # build network data_path <- system.file("extdata/poa", package = "r5r") r5r_core <- setup_r5(data_path = data_path, verbose = FALSE) # extract public transport network transit_net <- transit_network_to_sf(r5r_core) # stops Ok head(transit_net$stops) ggplot() + geom_sf(data = transit_net$stops, color='gray85') + theme_void() # routes ERROR head(transit_net$routes) ggplot() + geom_sf(data = transit_net$routes, color='gray85') + theme_void() > Error in CPL_geos_is_empty(st_geometry(x)) : > Evaluation error: IllegalArgumentException: point array must contain 0 or >1 elements.
We should check whether there are any invalid route goemetries and fixed them before returning the ouput.
if( any(FALSE, sf::st_is_valid(transit_net$routes)) ){ transit_net$routes <- st_make_valid(transit_net$routes) }
The text was updated successfully, but these errors were encountered:
02000cd
rafapereirabr
No branches or pull requests
Brief description of the problem:
The output of
transit_network_to_sf()
can generateroutes
with invalid geometries.Reproducible example here
suggested solution
We should check whether there are any invalid route goemetries and fixed them before returning the ouput.
The text was updated successfully, but these errors were encountered: