views:

56

answers:

1

Hi, I'm working with the iPhone SDK and am trying to gather and store a list of all addresses within a given radius (the radius will range from .25 to 19.75 miles). understandably the larger radius would produce a large amount of results, but for now I'd like to at least be able to do it for a mile or so.

The end result would be to have a database of the nearby addresses so I can choose a random sampling of them at any given time.

I know reverse geocoding can get me a specific address at a lat/long, but how would I go about gathering ALL addresses X miles from the center? Thanks!

EDIT: As an alternate method, if it's possible to just generate X amount of random points within the radius WITHOUT storing them in a database, that could work too.

+1  A: 

Gah, I'm an idiot. Went back to trig class for this one. I'll just randomize angle and distance between the center and radius.

x = xC + Rcos(theta)

y = yC + Rsin(theta)

Josh