CoreLocation 从坐标获取一定距离和方向的经纬度

Posted

技术标签:

【中文标题】CoreLocation 从坐标获取一定距离和方向的经纬度【英文标题】:CoreLocation get latitude and longitude at a certain distance and direction from coordinate 【发布时间】:2012-04-15 22:23:24 【问题描述】:

我正在尝试确定距另一个位置一定距离的位置。我在 ios 中使用 CoreLocation 中的纬度、经度。

谢谢。

【问题讨论】:

不知道如何回答。我整天都在阅读 iOS SDK 文档。我也读过这个janmatuschek.de/LatitudeLongitudeBoundingCoordinates,它是从另一个问题链接的。到目前为止,我被难住了。 【参考方案1】:
lat2 = asin(sin(lat1)*cos(d/R) + cos(lat1)*sin(d/R)*cos(θ))
lon2 = lon1 + atan2(sin(θ)*sin(d/R)*cos(lat1), cos(d/R)−sin(lat1)*sin(lat2))

R 是您首选单位的地球半径。 (6371 公里)

【讨论】:

能否详细说明。 d和R是什么?我假设 R 是球体的半径。我应该在哪里应用我希望从第 1 点开始测量的方向?编辑:我用谷歌搜索了这个公式,找到了这个网页movable-type.co.uk/scripts/latlong.html d 是经过的距离。 θ 是标题。

以上是关于CoreLocation 从坐标获取一定距离和方向的经纬度的主要内容,如果未能解决你的问题,请参考以下文章

在一定距离处查找经纬度四个方向的点

需要一种从 iPhone CoreLocation 上的地址获取 GPS 坐标的方法

如何从CoreLocation中的两个坐标获得对称坐标

沿某个方向移动 CGPoint 一定距离...iphone

如何使用 CoreLocation 框架而不是谷歌地图 API 获取任何给定地址的坐标?

在 Objective-C 中无法使用 CoreLocation 获取纬度和经度