Distance Matrix w/ custom bikeways layer and speed limits

Hi ORS Team and Comunity:

I am very grateful for your API. It is truly useful.

However, I have a problem: I must calculate a distance matrix, but I must consider the new bikepaths created by the municipal government. Is it possible to use the API with a personal layer of those city bikepaths?

For the analysis, I must also apply a current speed restriction, for certain streets in the downtown of the city where I live. How could I do it?

I thank you in advance for your response. Best regards.


this is in general a rather difficult request, I’ll try my best to explain the options I see.

The easiest way to do so is to map the new bikepaths in the OpenStreetMap (see Contribute Map Data). Note, that it’ll take a few weeks (usually around 2, but may be more or less depending on the actual date your edits are made) until the changes are reflected in the openrouteservice.

If that is not an option, you can also download the .osm-file for you region (e.g. here), add the bikepaths (e.g. with jsom) and run a local instance of the openrouteservice (find instructions here) using the modified .osm-file.

For a speed restriction, look at how speeds are calculated here. You can either set a maximum_speed for your request or, if you are modifying your .osm-file anyways, set a maxspeed=XX-tag on the corresponding ways.

Best regards