OSRM/API: OpenStreet Maps Calculate distance between points

curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?annotations=distance,duration' Response: { "code": "Ok", "distances": [ [0, 1887.3, 3802.9], [1903.1, 0, 2845.8], [3280.4, 2292.8, 0] ], "durations": [ [0, 251.5, 384.4], [258.1, 0, 363.5], [354.7, 301.1, 0] ], "sources": [{ "hint": "N85xha7OcYUYAAAABQAAAAAAAAAgAAAASjFaQdLNK0AAAAAAsPePQQwAAAADAAAAAAAAABAAAAA_6wAA_kvMAKlYIQM8TMwArVghAwAA7wrV7s3X", "distance": 4.231666, "location": [13.388798, 52.517033], "name": "Friedrichstraße" }, { "hint": "npYWgHzyeYUGAAAACgAAAAAAAAB2AAAAW7-PQOKcyEAAAAAApq6DQgYAAAAKAAAAAAAAAHYAAAA_6wAAf27MABiJIQOCbswA_4ghAwAAXwXV7s3X", "distance": 2.789393, "location": [13.397631, 52.529432], "name": "Torstraße" }, { "hint": "oZYWgP___38fAAAAUQAAACYAAAAeAAAAsowKQkpQX0Lx6yZCvsQGQh8AAABRAAAAJgAAAB4AAAA_6wAASufMAOdwIQNL58wA03AhAwMAvxDV7s3X", "distance": 2.226595, "location": [13.428554, 52.523239], "name": "Platz der Vereinten Nationen" }], "destinations": [{ "hint": "N85xha7OcYUYAAAABQAAAAAAAAAgAAAASjFaQdLNK0AAAAAAsPePQQwAAAADAAAAAAAAABAAAAA_6wAA_kvMAKlYIQM8TMwArVghAwAA7wrV7s3X", "distance": 4.231666, "location": [13.388798, 52.517033], "name": "Friedrichstraße" }, { "hint": "npYWgHzyeYUGAAAACgAAAAAAAAB2AAAAW7-PQOKcyEAAAAAApq6DQgYAAAAKAAAAAAAAAHYAAAA_6wAAf27MABiJIQOCbswA_4ghAwAAXwXV7s3X", "distance": 2.789393, "location": [13.397631, 52.529432], "name": "Torstraße" }, { "hint": "oZYWgP___38fAAAAUQAAACYAAAAeAAAAsowKQkpQX0Lx6yZCvsQGQh8AAABRAAAAJgAAAB4AAAA_6wAASufMAOdwIQNL58wA03AhAwMAvxDV7s3X", "distance": 2.226595, "location": [13.428554, 52.523239], "name": "Platz der Vereinten Nationen" }] }
"distances": [
[0, 1887.3, 3802.9],
[1903.1, 0, 2845.8],
[3280.4, 2292.8, 0]
],
"durations": [
[0, 251.5, 384.4],
[258.1, 0, 363.5],
[354.7, 301.1, 0]
],

Are the matrix for distances (mts) and durations (secs) betwen points.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.