What is the minimal number of fields needed in MySQL to store geocoding data from Google Maps?
Just to put the question in context.
I plan开发者_高级运维 to have an interface where a user will provide a one line address string. I will then use the string to do a Reverse Geocoding query on the Google Maps API. I will then store the results(formatted address, address components) in the database.
My question is what is the minimum number of fields needed so that I can display addresses in formats such as mailing address, shipping address, store address, etc?
Google geocoding V2 returns LAT, LNG, and accuracy.
Use float(10,6) for the LAT and LNG, and a tinyint for the accuracy.
V3 of the API gives you a formatted address along with the LAT and LNG, see the docs and list of columns here:
http://code.google.com/apis/maps/documentation/geocoding/#Types
Take note of this; "Note: the Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited."
精彩评论