This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Distance matrix API

3

Dears, could you please inform me if there are an Api that can give us the distance between A and B using API? Like Google Distance Matrix API.

Thanks.

asked 22 Oct '14, 12:27

Danil%20Rudakov's gravatar image

Danil Rudakov
46113
accept rate: 0%

(26 May '15, 14:53) SomeoneElse ♦

Hi guys,

I would like to do the same as the question ask, but is it free ?

(21 Aug '21, 09:56) hunae

4 Answers:

8

Yes, OSRM (Open Source Routing Machine) provides this feature - both for point-to-point queries and for matrices.

See https://github.com/Project-OSRM/osrm-backend/wiki/Server-api. There is a public instance at router.project-osrm.org which is available for light usage within the terms of use (see the OSRM wiki). An example matrix call would be:

http://router.project-osrm.org/table?loc=29.94,-90.11&loc=30.44,-91.18&loc=30.45,-91.22&loc=30.42,-91.15

If you have more significant needs, you can set up your own instance of OSRM.

answered 22 Oct '14, 12:48

Richard's gravatar image

Richard ♦
30.9k44279412
accept rate: 18%

edited 22 Oct '14, 12:49

This sounds interesting, is this p2p only? How about for matrices, i.e. m2m? Also, is this using geo coords only? Is there support for addresses? Or a way to identify the geo coords for an address? Thank you...

(31 Aug '20, 15:27) mwpowelllde

1

There is also the GraphHopper Directions API based on OSM data with a Matrix API providing times and distances. (Note: I'm the author of GraphHopper)

answered 26 Mar '15, 21:50

peatar's gravatar image

peatar
3512312
accept rate: 8%

edited 29 Jun '16, 09:15

0

Dislaimer: I work for iGeolise

The TravelTime API can be used to calculate the true distance from A to B (rather than as the crow flies) as well as calculating the travel time between the two points (plus lots more). Sign up for an API key here.

answered 16 Jun '16, 10:37

Louisa-maps's gravatar image

Louisa-maps
311
accept rate: 0%

Is the map data based on OSM?

(16 Jun '16, 11:37) scai ♦

0

as far as i found OSRM only provides a travel-time-matrix (although they call it distance matrix). if i am wrong, please post, because i am looking for distance matrices

answered 29 Jun '16, 08:30

gemerden's gravatar image

gemerden
1
accept rate: 0%

Source code available on GitHub .