Code4HR / open-health-inspection-scraper

Scraper for the open-health-inspector app.
Apache License 2.0
7 stars 9 forks source link

geocoding addresses #8

Closed ttavenner closed 10 years ago

ttavenner commented 10 years ago

I ran some tests with the handful of data in the DB this morning. I was able to get good lat/long using geopy (https://code.google.com/p/geopy/wiki/GettingStarted) without providing an API key. I used the exact format in the example

from geopy import geocoders
g = geocoders.GoogleV3()
addr, (lat, lng) = g.geocode(vendor["address"]+" in "+vendor["city"])

worked like a charm. You could include the state if you wanted to be sure, but it seemed to detect it without fail. Might also be good for including more complete address info in the database since it standardizes and provides city, state, zip.

Not sure if it will handle the entire list without complaint but its worth a try. I tested some of the others provided in the library, like geocoder.us, but none seemed to return any data.

wbprice commented 10 years ago

Worst case scenario, we grab all the info over the course of a few days. Awesome. I'm still getting some of the bugs worked out of geolocation in the browser (two way data-binding not as magical as advertised, or I'm just doing it wrong) so this is timely.