从一系列可能的位置中找到最佳的经度/纬度匹配
我有一个包含 12 个具有唯一键的对象的 plist(比方说 1、2、3 等)。每个对象都包含一个包含 100 - 200 个对象的数组(键:clubLocations
)。
clubLocations
数组中的每个对象都包含一个 longitude
和 latitude
键以及俱乐部的位置。
我需要一些帮助来创建一个方法,该方法循环遍历每个对象对于每个clubLocations每12个对象并找出哪个clubLocation是最接近的与用户坐标匹配。
所以基本上反对 1/2/3/etc -> ClubLocations objectAtIndex:0/1/2/3/etc ->最佳匹配?
我有用户的坐标,所以“只是”需要帮助从我的 plist 中找到最近的位置。预先感谢您,如果我说得不够清楚,请随时在评论中询问。
I have a plist with 12 objects with unique keys (let's say 1, 2, 3, etc). Each object contains an array (key: clubLocations
) with 100 - 200 objects.
Each object in the clubLocations
array contains a longitude
and latitude
key with a club's location.
I would like some assistance in creating a method which loops through each object for every clubLocations in every 12 objects and finds out which clubLocation is the closest match to the users coordinates.
So basically object 1/2/3/etc -> clubLocations objectAtIndex:0/1/2/3/etc -> best match?
I have the user's coordinates, so "just" need assistance to find the closest locations from my plist. Thank you in advance and please do not hesitate to ask in a comment if I am not making myself clear enough.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在伪代码中:
In pseudocode: