osrm-backend icon indicating copy to clipboard operation
osrm-backend copied to clipboard

one to many

Open ayrus96 opened this issue 3 years ago • 2 comments

Hi, I am looking for API to achieve one source to many destination in routing... but table service api doesn't return any gemetry to view in map...

how can i solve this in OSRM? any ideas??

ayrus96 avatar Jul 08 '22 05:07 ayrus96

You will need to make multiple calls to the /route service to get geometry for many routes like that. The /table service does not generate the full path geometry (even internally, which is one of the reasons it's so fast).

danpat avatar Jul 08 '22 06:07 danpat

Use osrm node-bindings. https://github.com/Project-OSRM/osrm-backend#using-the-nodejs-bindings.

Wrap your source-destination combos in promises and use await Promise.all(promises) to obtain all resolved queries. This is fast, an order of magnitude faster than issuing multiple requests to the http api.

handcath avatar Aug 07 '22 23:08 handcath