In my town, recently a delivery company has been opened (think DoorDash but on a much smaller scale and only doing local deliveries). Now what really confuses me is that they charge pennies for each delivery and they offer a quite smooth delivery tracking feature. Now, I know for a fact that they are using Google’s API for tracking the deliveries and from what I could find on Google, this comes out to ~5$ per 1000 requests. Okay let’s do some math
The exact delivery cost comes to around 1-3e depending on the distance. To obtain the desired smoothness of the tracking feature, you need to update the courier’s location at least every second. Suppose the delivery takes 15 minutes. This is 900 requests, or 4.5$ just for the delivery tracking. Clearly infeasible!
I thought about how I would optimise this and I came up with one not so perfect solution. Namely, you would deliberately have 5 second latency between the actual location and the last received location, and you would display courier moving with constant speed in the last 5 seconds, until you get the next location. This would significantly decrease the number of sent requests and also 5 seconds latency is not a lot, but I am sure there has to be a better way.
Am I completely missing the point of how Google maps API works, or is there a more clever way to resolve this?
Thank you for your input on this.