0

I wish to get the distance and the travel time from one map point to another in open street map in json format for my laravel based website. How can i do this? Since i am new to open street map, i am not aware of the steps to follow. Please help me. Thanks in advance

asked 31 Jul '15, 10:56

sujitha's gravatar image

sujitha
11223
accept rate: 0%


One Answer:
3

Computing the travel distance between two points requires a routing engine. A routing engine needs to be run on a server. There are a couple of people who operate such servers and who will let you use them for free, for example the server at http://map.project-osrm.org. That site also contains documentation about how to call the server and get a JSON response (or just switch on your browser's net debugger and see what requests it sends).

Be aware however that if you should set up a web site that makes many such routing requests, or even a commercial site of which such routing is an integral part, then you should not use these volunteer run resources, but instead set up your own routing server. The software and the data are free for the taking - but the computing resources need to be paid for by someone!

permanent link

answered 31 Jul '15, 11:10

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
73.3k866641137
accept rate: 24%

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×294
×51

question asked: 31 Jul '15, 10:56

question was seen: 11,670 times

last updated: 15 Feb '19, 20:52

powered by OSQA