views:

52

answers:

2

I have a database with addresses in which need to be converted to geocode to work with Google Maps API, i was thinking of bringing in the entries via JSON. Is there an easy way to get the addresses from the database convert them to geocode and create and JSON feed?

There are about 4000-5000 entires.

I know Google offer the Geocoding API, is there a way to intergrate this?

+1  A: 

You probably want to write some server side code that runs through your database entries making GeoCoding HTTP requests for each address and then storing the lat/lng responses you get back from Google. You can run this process once (and probably throttle the GeoCoding requests so you don't hit request limits) because it is unlikely the lat/lngs associated with your address will change.

Once the lat/lngs are stored in your database (for each of your address entries) you can just return the location in your JSON.

Cannonade
A: 

In case you do not want to write any code, you could simply use a service like bulkgeocoder.com to get the latitude/longitude data for the 5000 records. You basically export your data to a file, get the file geocoded from the service and then import it back to the database.

Geocoder