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

Immediate error message #31

Closed
Linalalina opened this issue Jun 25, 2018 · 2 comments
Closed

Immediate error message #31

Linalalina opened this issue Jun 25, 2018 · 2 comments

Comments

@Linalalina
Copy link

Immediate error message

Thanks for this awesome package, I use it a lot to get road distances for my current project. I used to get error messages like this usually if I sent many coordinate pairs (approx. 10000) but since a week ago I immediately get the following message, without any distances/duration returned:
OSRM returned an error:
Error in if (res$code != "Ok") {: argument is of length zero

Error in osrm@data :
trying to get slot "data" from an object of a basic class ("NULL") with no slots

I think it was a API thing before but since it doesn’t work at all anymore, maybe you have any advice how to deal with it?
If it helps, here’s the code I send (to get all IDs I need I write all results into a dataframe, didn't use to be a problem before either):

dist <- data.frame(CID=distdat$CID, zipstart=distdat$zip, ptend=distdat$id, duration=NA, length=NA)
for (i in 1:15000)
{ osrm <- osrmRoute (src = distdat[i, c("zip","x","y")],
dst = distdat[i, c("id","long","lat")], sp="TRUE")
dist[i,4] <- osrm@data[1,3]
dist[i,5] <- osrm@data[1,4]
}

THANK YOU!!

@rCarto
Copy link
Member

rCarto commented Jun 25, 2018

Hello,
I have the same error message from time to time. The error message on the demo server is "{"message":"Too Many Requests"}".
You can try to replay the script and it may work.
The OSRM demo server, it is not always very stable.

The best solution is of course to run your own instance of OSRM, if it's possible...

@Linalalina
Copy link
Author

Thanks, that's what I feared. But I will try to set up my own instance, thanks for the advise!

@rCarto rCarto closed this as completed Jun 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants