Re: [OSRM-talk] osrm route directly from command line not via http possible?

2015-03-14 Thread Florian Lohoff
On Tue, Mar 10, 2015 at 04:14:43PM +, Michael Leonard wrote:
> More info
> 
> OSRM is already extremely fast when called using curl http://localhost … -
> however I’m looking to include it an algorithm to generate millions of
> realistic driving routes, and am hoping that the underlying C++ routing
> function might be accessible from the command line directly in some way.
> With a command line function that wraps around OSRM’s routing algorithm, I
> could call this from within R where I’m writing the rest of my code.

I am doing similar things and i am using the http API with geometry
compression turned off. With perl getting the route and geometry and
putting it as an WKT into a postgres on the same machine i observe
 >500 routes/s

Flo
-- 
Florian Lohoff f...@zz.de
 We need to self-defense - GnuPG/PGP enable your email today!


signature.asc
Description: Digital signature
___
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk


Re: [OSRM-talk] osrm route directly from command line not via http possible? (Michael Leonard)

2015-03-12 Thread Leonardo Yvens
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


Re: [OSRM-talk] osrm route directly from command line not via http possible?

2015-03-12 Thread Peter, Michael
Hallo,


if I understand you right, you want to automatically request routes from OSRM 
and work with them in your code?


You can use

https://github.com/Project-OSRM/osrm-backend/wiki/Server-api

to request route informations from your server.

e.g. with a simple curl/wget from bash or a http interface of your language of 
choice.


OSRM Server will return a json for each request file containing all routing 
Information


Best regards

Michael


Von: Michael Leonard 
Gesendet: Dienstag, 10. März 2015 17:14
An: osrm-talk@openstreetmap.org
Betreff: [OSRM-talk] osrm route directly from command line not via http 
possible?

Hi


I'm new to OSRM and the mailing list but have managed to get it all working 
well on a 64bit Ubuntu 14.04 server.

I'm writing looking for help to get OSRM's routing algorithm working directly 
from the command line rather than via http.


More info

OSRM is already extremely fast when called using curl http://localhost ... - 
however I'm looking to include it an algorithm to generate millions of 
realistic driving routes, and am hoping that the underlying C++ routing 
function might be accessible from the command line directly in some way. With a 
command line function that wraps around OSRM's routing algorithm, I could call 
this from within R where I'm writing the rest of my code.

My C++ skills are unfortunately at the extreme beginner level, but I have found 
where I might start if I were much more advanced: either the file 
simpleclient.cpp in the OSRM github repo or the node_osrm.cpp file in the 
node-osrm repo which looks like it's similar to simpleclient.cpp.

Hopefully someone has already crossed this bridge and could I'm hoping provide 
some kind of simple command-line wrapper function to these underlying c++ 
functions so that I can avoid the http approach which I'm guessing slows things 
down.


Thanks in advance...

Thanks so much in advance I really appreciate any help or tips to get this 
working

Love osrm by the way


Mike


PS

I posted this on stackoverflow but found this mailing list and thought I might 
have more luck using it.

http://stackoverflow.com/questions/28958577/open-source-routing-machine-via-the-commandl
___
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk


Re: [OSRM-talk] osrm route directly from command line not via http possible?

2015-03-11 Thread Stephen Woodbridge

On 3/11/2015 10:12 AM, Michael Leonard wrote:

Hi Steve

Thanks for the message!  Yes I found simpleclient.cpp before... but
unfortunately I don't know where to start to turn that into a command I
can call from the command line to generate a route I'm afraid.

If it's not too much trouble, would you be able to share any example
code or tips on how to turn simpleclient.cpp into something I can call
from the command line?  I'd really really appreciate any help!


Micheal,

It is a command line the generates a route from start_coordinate to 
end_coordinate and prints out the result.


Mimic this code and substitute your coordinates and do something with 
the output.


You have not defined your requirements in enough detail for anyone to be 
more specific. Also you will need to do some C++ programming to 
implement whatever you need.


-Steve

PS: If you want some consulting help to build a specific tool contact me 
off-list.





Thanks

Kind regards

Mike

PS

On 10 March 2015 at 16:26, Stephen Woodbridge mailto:wood...@swoodbridge.com>> wrote:

Michael,

Take a look at this.


https://github.com/Project-__OSRM/osrm-backend/blob/master/__tools/simpleclient.cpp



I have used it to wrap OSRM into some VRP code. I also recommend
using osrm-datastore to host the data, then you can make multiple
parallel request to that and we were getting 5-8ms responses to
route queries.

-Steve


On 3/10/2015 12:14 PM, Michael Leonard wrote:

Hi

I'm new to OSRM and the mailing list but have managed to get it all
working well on a 64bit Ubuntu 14.04 server.

I’m writing looking for help to get OSRM’s routing algorithm working
directly from the command line rather than via http.


More info

OSRM is already extremely fast when called using |curl
http://localhost
…| - however I’m looking to include it an algorithm to generate
millions
of realistic driving routes, and am hoping that the underlying C++
routing function might be accessible from the command line
directly in
some way. With a command line function that wraps around OSRM’s
routing
algorithm, I could call this from within R where I’m writing the
rest of
my code.

My C++ skills are unfortunately at the extreme beginner level, but I
have found where I might start if I were much more advanced:
either the
file simpleclient.cpp in the OSRM github repo or the
node_osrm.cpp file
in the node-osrm repo which looks like it's similar to
simpleclient.cpp.

Hopefully someone has already crossed this bridge and could I'm
hoping
provide some kind of simple command-line wrapper function to these
underlying c++ functions so that I can avoid the http approach
which I'm
guessing slows things down.


Thanks in advance...

Thanks so much in advance I really appreciate any help or tips
to get
this working

Love osrm by the way


Mike


PS

I posted this on stackoverflow but found this mailing list and
thought I
might have more luck using it.


http://stackoverflow.com/__questions/28958577/open-__source-routing-machine-via-__the-commandl




_
OSRM-talk mailing list
OSRM-talk@openstreetmap.org 
https://lists.openstreetmap.__org/listinfo/osrm-talk




_
OSRM-talk mailing list
OSRM-talk@openstreetmap.org 
https://lists.openstreetmap.__org/listinfo/osrm-talk





___
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk




___
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk


Re: [OSRM-talk] osrm route directly from command line not via http possible?

2015-03-11 Thread Michael Leonard
Hi Steve

Thanks for the message!  Yes I found simpleclient.cpp before... but
unfortunately I don't know where to start to turn that into a command I can
call from the command line to generate a route I'm afraid.

If it's not too much trouble, would you be able to share any example code
or tips on how to turn simpleclient.cpp into something I can call from the
command line?  I'd really really appreciate any help!

Thanks

Kind regards

Mike

PS

On 10 March 2015 at 16:26, Stephen Woodbridge 
wrote:

> Michael,
>
> Take a look at this.
>
> https://github.com/Project-OSRM/osrm-backend/blob/master/
> tools/simpleclient.cpp
>
> I have used it to wrap OSRM into some VRP code. I also recommend using
> osrm-datastore to host the data, then you can make multiple parallel
> request to that and we were getting 5-8ms responses to route queries.
>
> -Steve
>
>
> On 3/10/2015 12:14 PM, Michael Leonard wrote:
>
>> Hi
>>
>> I'm new to OSRM and the mailing list but have managed to get it all
>> working well on a 64bit Ubuntu 14.04 server.
>>
>> I’m writing looking for help to get OSRM’s routing algorithm working
>> directly from the command line rather than via http.
>>
>>
>> More info
>>
>> OSRM is already extremely fast when called using |curl http://localhost
>> …| - however I’m looking to include it an algorithm to generate millions
>> of realistic driving routes, and am hoping that the underlying C++
>> routing function might be accessible from the command line directly in
>> some way. With a command line function that wraps around OSRM’s routing
>> algorithm, I could call this from within R where I’m writing the rest of
>> my code.
>>
>> My C++ skills are unfortunately at the extreme beginner level, but I
>> have found where I might start if I were much more advanced: either the
>> file simpleclient.cpp in the OSRM github repo or the node_osrm.cpp file
>> in the node-osrm repo which looks like it's similar to simpleclient.cpp.
>>
>> Hopefully someone has already crossed this bridge and could I'm hoping
>> provide some kind of simple command-line wrapper function to these
>> underlying c++ functions so that I can avoid the http approach which I'm
>> guessing slows things down.
>>
>>
>> Thanks in advance...
>>
>> Thanks so much in advance I really appreciate any help or tips to get
>> this working
>>
>> Love osrm by the way
>>
>>
>> Mike
>>
>>
>> PS
>>
>> I posted this on stackoverflow but found this mailing list and thought I
>> might have more luck using it.
>>
>> http://stackoverflow.com/questions/28958577/open-
>> source-routing-machine-via-the-commandl
>>
>>
>> ___
>> OSRM-talk mailing list
>> OSRM-talk@openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/osrm-talk
>>
>>
>
> ___
> OSRM-talk mailing list
> OSRM-talk@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/osrm-talk
>
___
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk


Re: [OSRM-talk] osrm route directly from command line not via http possible?

2015-03-10 Thread Stephen Woodbridge

Michael,

Take a look at this.

https://github.com/Project-OSRM/osrm-backend/blob/master/tools/simpleclient.cpp

I have used it to wrap OSRM into some VRP code. I also recommend using 
osrm-datastore to host the data, then you can make multiple parallel 
request to that and we were getting 5-8ms responses to route queries.


-Steve

On 3/10/2015 12:14 PM, Michael Leonard wrote:

Hi

I'm new to OSRM and the mailing list but have managed to get it all
working well on a 64bit Ubuntu 14.04 server.

I’m writing looking for help to get OSRM’s routing algorithm working
directly from the command line rather than via http.


More info

OSRM is already extremely fast when called using |curl http://localhost
…| - however I’m looking to include it an algorithm to generate millions
of realistic driving routes, and am hoping that the underlying C++
routing function might be accessible from the command line directly in
some way. With a command line function that wraps around OSRM’s routing
algorithm, I could call this from within R where I’m writing the rest of
my code.

My C++ skills are unfortunately at the extreme beginner level, but I
have found where I might start if I were much more advanced: either the
file simpleclient.cpp in the OSRM github repo or the node_osrm.cpp file
in the node-osrm repo which looks like it's similar to simpleclient.cpp.

Hopefully someone has already crossed this bridge and could I'm hoping
provide some kind of simple command-line wrapper function to these
underlying c++ functions so that I can avoid the http approach which I'm
guessing slows things down.


Thanks in advance...

Thanks so much in advance I really appreciate any help or tips to get
this working

Love osrm by the way


Mike


PS

I posted this on stackoverflow but found this mailing list and thought I
might have more luck using it.

http://stackoverflow.com/questions/28958577/open-source-routing-machine-via-the-commandl


___
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk




___
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk


[OSRM-talk] osrm route directly from command line not via http possible?

2015-03-10 Thread Michael Leonard
Hi

I'm new to OSRM and the mailing list but have managed to get it all working
well on a 64bit Ubuntu 14.04 server.

I’m writing looking for help to get OSRM’s routing algorithm working
directly from the command line rather than via http.


More info

OSRM is already extremely fast when called using curl http://localhost … -
however I’m looking to include it an algorithm to generate millions of
realistic driving routes, and am hoping that the underlying C++ routing
function might be accessible from the command line directly in some way.
With a command line function that wraps around OSRM’s routing algorithm, I
could call this from within R where I’m writing the rest of my code.

My C++ skills are unfortunately at the extreme beginner level, but I have
found where I might start if I were much more advanced: either the file
simpleclient.cpp in the OSRM github repo or the node_osrm.cpp file in the
node-osrm repo which looks like it's similar to simpleclient.cpp.

Hopefully someone has already crossed this bridge and could I'm hoping
provide some kind of simple command-line wrapper function to these
underlying c++ functions so that I can avoid the http approach which I'm
guessing slows things down.


Thanks in advance...

Thanks so much in advance I really appreciate any help or tips to get this
working

Love osrm by the way


Mike


PS

I posted this on stackoverflow but found this mailing list and thought I
might have more luck using it.
http://stackoverflow.com/questions/28958577/open-source-routing-machine-via-the-commandl
___
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk