We are developing a travel app project to facilitate customized travel experience. Where traveller can plan its trip by selecting various facilities like ATM, Restaurants, attraction points while traveling from an origin to destination. Facilities coordinates across India has been stored in our database as prerequisite.
I am looking for a logic, that will help me choosing all facilities that are 5 KM radius from the driving route. Also the distance and travel time should be shown while planning the trip.
The existing logic that we have used is,
- Pick all Google waypoint using Google API for a particular motorized route i.e. origin to destination.
- Using haversine formula to find other waypoint in 5KM radius for that route.
- Using vlookup shortlist all facilities that are falling in 5KM radius waypoints.
- For accuracy, fetch motorized distance and travel time from Google distance matrix API.
The above logic is working but is not optimized for number of Google API calls. It is generating huge number of Google API calls while planning a trip.
Is there any better logic that can be used with minimum number of Google API? Can ML help me in optimize the logic, if yes which algorithm/logic will help me optimising this logic.