I am developing a proof of concept/prototype for an internal tool. The basic premise is, that we have a couple of units that have a GPS on them, and they report their location (with typical GPS accuracy in NMEA format) to a java api I have built in a cloud environment.
[Device GPS] -> [Sends Cellular GSM request to API] -> [API queries Google
Roads] -> [Google Roads returns snapped coordinates] -> [App maps received
coordinates]
The java API takes the reported coordinates, and essentially sends a request to the Google Maps Roads API and uses the Snap-to-road
feature (this will essentially take whatever point you gave it along with an optionally traveled path of coordinates, and give you coordinates back that are essentially on the path it believes you are traveling). This is great and all, but with one setback.
IT IS EXPENSIVE.
For two devices reporting their location (similar to the way Uber or Lyft may do it) every few seconds, the cost of running this application essentially makes it a sunk cost. 24,000 queries will cost you $300-500. For one device.
We have taken a few efforts to only accept requests to the API during work hours - but that is still barely scratching the surface.
I am fairly capable at writing whatever I would need (I believe at least), or can find libraries to do what I think needs to be done - but I have no idea what recourse to take. I am thinking of something along the lines of caching requests in another table and querying that first, but I am not certain how reliable that will be.
Has anyone implemented such a solution or something similar? I just need to defray the amount of requests I send to Google Maps' API before I bankrupt this project.