Hello Michael,

I recently came across a similar issue, I wanted to make OSRM requests
skipping as much overhead as possible. I was making as many requests as I
could on multiple threads, and eventually the local OSRM server would just
hang. By integrating OSRM as a library, the performance at least doubled.

 When you build OSRM, it generates libOSRM.a, which is a static library
with all the OSRM code. Since my project was in C++, I could call it
directly. There must be some way you can call it from R.

http://pastebin.com/Dj9E7rkk

This is some C++ code that calls the OSRM functions. You could make a small
command line application that takes the coordinates as parameters and pass
it to that. Don't worry about the http:Reply thing, there is no networking
or I/O overhead involved, it will just render the json to the
reply.contents.
_______________________________________________
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk

Reply via email to