2

Several questions, such as this one, discuss whether to store only lat/long in the database & calculate the street address every time it is needed, but they seem to miss a few points & seem to be opinion, rather than authoritative.

Hence this question, seeking a final, definitive clarification, with justification.

1) reverse geocode every time
pro - smaller database size (why should everyone duplicate Google's database?)
cons - might occasionally fail whereas storing the result will not

2) store address in the database
pro - less likely to hit a Google imposed limit on the number of requests
con - could be a large amount of data. A few hundred vehicles storing a new location every 5 minutes or so, 16 hours per day... probably more coding

If I take approach 2), I plan a new MySql table for addresses, indexed by lat/long and storing the street address. Every time a vehicle reports position, look for a matching address. If none, calculate & add.

In addition: later, when a client requests movement history, if the address is blank, attempt to calculate & store if found.

I am restricted to using a MySQL database.

1
  • In response to the con in #1, in most cases a private database will probably fail more often than Google's services. Commented Aug 26, 2014 at 23:00

1 Answer 1

5

You cannot legally cache or store results from Google's Map API (with pretty narrow exceptions).

From the Terms of Service (with emphasis added):

10.1.3 Restrictions against Data Export or Copying.

...

(b) No Pre-Fetching, Caching, or Storage of Content. You must not pre-fetch, cache, or store any Content, except that you may store: (i) limited amounts of Content for the purpose of improving the performance of your Maps API Implementation if you do so temporarily (and in no event for more than 30 calendar days), securely, and in a manner that does not permit use of the Content outside of the Service; and (ii) any content identifier or key that the Maps APIs Documentation specifically permits you to store. For example, you must not use the Content to create an independent database of "places" or other local listings information.

So option 1 it is, unless you only use the geocoding for the purposes described in the Maps API ToS, and only temporarily cache.

3
  • 3
    Note that it is permitted limited amounts of Content for the purpose of improving the performance of your Maps API Implementation if you do so temporarily (and in no event for more than 30 calendar days). Commented Apr 21, 2014 at 13:46
  • Cthulhu: Noted, and I did quote that. Extended the last sentence. Commented Apr 21, 2014 at 20:54
  • +1 Thanks, I forgot to RTFM. Given that restriction, I now have to decide whether to cache for zer0 days or 29 days. And I suspect that we each of us have a different piece of string. Commented Apr 22, 2014 at 4:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.