I am experimenting with table service, the first restriction I thought about is the URL query length, as it work by http get request.

I need to send 5000 location, considering location is 35 characters long as for example:


thus, I will be sending 175000 character in the url, which is not possible I think for all browsers.

I will pass the result of durations matrix into the vehicle routing problem solver of Google Optimization Tools with the duarion matrix of a 5000 input location.

Here is an example of my query for small number of locations:


Any advice?


You will need to set up your own instance of OSRM for a 5000x5000 input matrix. The hosted version at router.project-osrm.org only supports small matrices.
When working with your own instance, you can change the max-table-size parameter (see also How can I increase limits of OSRM table function?)

To reduce the the number of characters in the URL, you can encode the points using Google's polyline algorithm. (Don't worry, there are libraries for JavaScript and other common languages to do this).


I faced a similar issue. I fixed by forking OSRM and adding the support for Http POST, and sending all these parameters in the POST body instead of the Url. You can take a look at my OSRM fork. But the caveat is that you have to host the OSRM server yourself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.