How to calculate fare

Viewed 16

like Ola, Uber etc. how they calculate fare Example when I start from one point to another (like 1 to 2km) shows amount that is 40 rs
how they calculate use map distance in code or something else in code can u please explain how it work? Simply how it works fare system works?

1 Answers

This is lifted directly from the Uber website:

Many data points go into calculating an upfront price, including the estimated trip time, distance from origin to destination, time of day, route, and demand patterns. It also includes tolls, taxes, surcharges, and fees (with the exception of wait time fees).

Some cities do not provide upfront prices. Instead, you’re charged either a minimum price or a price based on the time and distance for your trip’s route, which may include a base fare, a Booking Fee, surcharges, tolls, and dynamic pricing. Prices may vary by location, the vehicle option you select, and other factors.

So it sounds like a combination of any relevant data points your app is able to collect and that you feel should be considered billable are applied to the calculation. I imagine you would want to use the map distance rather than a predefined route in case of detours, traffic, etc.

Related