How to add bus routes on map and connect it with OSRM?

Viewed 43

I am saving all bus routes data in my database. Whenever user requests if there is available routes from point A to point B, server should give the user response containing the available bus routes from point A to point B, and one more condition if there is no straight bus routes from point A to point B, then the response should give the available routes by transfers. So if there are no straight routes, first we need to find intersection point of route 1 and route 2, in which route 1 contains point A and route 2 contains point B. From A to Intersection point, and from Intersection point to point B.

I am saving route data as array of bus stops, and bus stops are consisting of latitude and longitude.

0 Answers
Related