Closed ImLukeSkywalker closed 3 years ago
Hello, Can you please provide a reproducible example (data and code).
Hi,
I'm getting the same error. Starting a new session, if I run the example from the project documentation, I get the following:
library(osrm) iso <- osrmIsochrone(loc = c(13.43,52.47), breaks = seq(0,14,2)) The OSRM server returned an error: Error in doTryCatch(return(expr), name, parentenv, handler): object 'res' not found
Thank you
Hello, Can you please provide a reproducible example (data and code).
Sure, I attach the shapefile that I'm using and the code it's:
lugar<-read_sf("E:/2021/Ruralidad LA/Panamá/Isocronas/Lugarespoblados.shp")
isochrone <- map2(lugar$LONG, lugar$LAT, ~ osrmIsochrone(loc = c(.x, .y), breaks = seq(0, 180, 30))) %>% do.call(what = rbind)
isochrone@data$drive_times <- factor(paste(isochrone@data$min, "a", isochrone@data$max, "Minutos"))
factpal <- colorFactor("Blues", isochrone@data$drive_times, reverse = TRUE)
leaflet() %>%
setView(mean(lugar$LONG), mean(lugar$LAT), zoom = 7) %>%
addProviderTiles("Stamen.TonerLite") %>%
addPolygons(fill = TRUE, stroke = TRUE, color = "black",
fillColor = ~factpal(isochrone@data$drive_times),
weight = 0.5, fillOpacity = 0.4,
data = isochrone, popup = isochrone@data$drive_times,
group = "Drive Time") %>%
addLegend("bottomright", pal = factpal, values = isochrone@data$drive_time,
title = "Isocronas")
Hello, this problem is most probably due to changes made to the demo server (decrease max size of table requests).
The dev version of OSRM should work now.
remotes::install_github("riatelab/osrm")
However, the best solution to avoid this kind of disappointment is to run your own OSRM server. It allows to run faster and unlimited requests.
Nice its working now! Thank you so much. How can I access to an OSRM server?
The best way is to run it on your own computer with docker. Links are provided in this repo README (https://github.com/riatelab/osrm#description)
Hello! I havent find information about this error, and I'm not sure if it's from OSRM or I need to load another package.
This is my code:
lugar<-read_sf("E:/2021/Ruralidad LA/Panamá/Isocronas/Lugarespoblados.shp")
isochrone <- map2(lugar$LONG, lugar$LAT, ~ osrmIsochrone(loc = c(.x, .y), breaks = seq(0, 120, 30))) %>% do.call(what = rbind)
Start running and I get this error: The OSRM server returned an error: Error in doTryCatch(return(expr), name, parentenv, handler): objeto 'res' no encontrado
I already tried changin server with this: options(osrm.server = "https://routing.openstreetmap.de/", osrm.profile = "car")
Error in UseMethod("st_as_sf") : no applicable method for 'st_as_sf' applied to an object of class "NULL"
But I still failling...
Thanks for your answer.