对半径内的所有地址进行反向地理编码
我正在使用 iPhone SDK,并尝试收集和存储给定半径(半径范围从 0.25 到 19.75 英里)内的所有地址的列表。可以理解的是,较大的半径会产生大量的结果,但现在我希望至少能够做到一英里左右。
最终结果将是拥有附近地址的数据库,这样我就可以在任何给定时间对它们进行随机抽样。
我知道反向地理编码可以为我提供经纬度的特定地址,但我如何收集距中心 X 英里的所有地址?谢谢!
编辑:作为一种替代方法,如果可以在半径内生成 X 个随机点而不将它们存储在数据库中,那么这也可以工作。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嘎嘎,我是个白痴。为了这一节回到了三角课。我将随机化中心和半径之间的角度和距离。
x = xC + Rcos(theta)
y = yC + Rsin(theta)
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)