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

How to set up distance calculation (and maps) on web site

0

Hi, we have a php web app using Google Maps in the moment where you can check for the nearest shop from your location. Then the 10 nearest shops with driving time are offered. The area which has to be covered is about 100 x 400 km, there are about 100 users per day doing this request (so 1000 times a distance maxtrix has to be called).

I am just getting started with OSRM, so I have very basic questions:

  • Do I have to - or would it be better - to set up the map on our own (shared) server?
  • What capacity would I need for our task?
  • If yes, is there a way to do this just using php? I only came across this https://datawookie.netlify.com/blog/2017/09/building-a-local-osrm-instance/ which needs access on Linux, which we don't have in the moment. I found an api on githup, but that seems untouched for many years.

So any basic tutorial on how to achieve the task would be very helpful!

asked 21 Oct '19, 10:37

Kratz's gravatar image

Kratz
21112
accept rate: 0%

edited 21 Oct '19, 19:04

andy%20mackey's gravatar image

andy mackey
13.2k87143285


One Answer:

0

Installing any routing software on your own server will require command-line access - you certainly won't be able to do it with just PHP.

You may find it easier to use a third-party provider. These include Graphhopper, Geofabrik, and Mapbox. Generally these will run OSRM, Graphhopper or Valhalla, which are all OSM-based routing engines. You can then simply call their API from your PHP script.

answered 21 Oct '19, 13:31

Richard's gravatar image

Richard ♦
30.9k44279412
accept rate: 18%

Source code available on GitHub .