bzswords / HospitalRadar

Web Application that tracks the location and information of hospitals based on user input
0 stars 0 forks source link

Cache geocodes/geocode in waves #10

Closed bzswords closed 10 years ago

bzswords commented 10 years ago

Google puts limits on number of geocodes a day and how quickly you can geocode locations. Too many locations being geocoded at once will result in blocking. Fiona actually ran into this yesterday when trying to run a large array of hospitals through the geocoder. We need to implement a caching system to help with this issue as described here: https://developers.google.com/maps/articles/geocodestrat and here: http://gis.stackexchange.com/questions/15052/how-to-avoid-google-map-geocode-limit

We could also geocode in waves, with each wave being separated by however many seconds are needed to satisfy google.

bzswords commented 10 years ago

Method chosen: timeout - We will plot x number of markers every y seconds so that x is the max number of geocodes we can get in one call, and y is the min number of seconds required inbetween geocoding calls

bzswords commented 10 years ago

Possible solution - http://stackoverflow.com/questions/18434908/pause-loop-for-a-second-after-every-five-iterations

bzswords commented 10 years ago

performance of code in this commit 2f822fd9be9c9216bc2c86b06c9e1c4054766506 shows that we NEED to implement caching

atareen commented 10 years ago

NEED

bzswords commented 10 years ago

Caching implemented

Commit: 5d376b1622