NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi, I'm doing a program on nodejs where I need to know how close I am to a point. I have two points represented by coordinates and I need the minutes it would take to get from one point to another. The request or query would be to the global OSM, I cannot have an instance of this. Would this be possible?

Thank you very much.

asked 16 May '18, 11:08

Wolfindel's gravatar image

Wolfindel
26224
accept rate: 0%


Hello,

I suggest you have a look at :
- https://www.graphhopper.com/
- http://project-osrm.org/

Both are routing API based on OpenStreetMap data. You can test both here : https://www.openstreetmap.org/directions

permanent link

answered 16 May '18, 15:59

jbelien's gravatar image

jbelien
146129
accept rate: 16%

Thank you so much for the answer.

"https://www.graphhopper.com/" is paid but "http://project-osrm.org/" is free and works well. However, with this one you can only make a few requests and I need to make several in a row, so I don't think that with that limitation it will work for me. He complains about the following when making several inquiries"{ message: 'Too Many Requests' }".

Can I get the html from the code of a route request on OSM?

For example, from this query "https://www.openstreetmap.org/directions?engine=graphhopper_car&route=38.0088%2C-1.1588%3B37.9859%2C-1.1306#map=14/37.9992/-1.1453" keep the minutes of arrival.

Thank you very much.

(24 May '18, 11:51) Wolfindel

The route request on OSM uses GraphHopper or OSRM. That's why I suggested to use those :)

If you need a free and open-source solution without any request limitation, have a look at Itinero Routing API (developed by Ben Abelshausen) : https://github.com/itinero/routing-api

I published a tutorial on how to install (and use) it : https://gist.github.com/jbelien/84273bf8dcf9038b0a2cd7ef2cb80142

(24 May '18, 12:07) jbelien

Installing Graphhopper locally is relatively simple. Or try pgrouting on PostGIS (osm2po is a simple to use tool to populate the DB)

(24 May '18, 12:37) SK53 ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

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:

×710
×29

question asked: 16 May '18, 11:08

question was seen: 2,779 times

last updated: 24 May '18, 12:37

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum