【发布时间】:2020-01-15 18:46:08
【问题描述】:
我手头有一个包含 GPS 速度的 GPS 日志数据集。数据集如下所示:
id | gpstime | lat | lon | speed
--------+------------+------------+------------+---------
157934 | 1530099776 | 41.1825026 | -8.5996864 | 3.40901
157934 | 1530099777 | 41.1825114 | -8.599722 | 3.43062
157934 | 1530099778 | 41.1825233 | -8.5997594 | 3.45739
157934 | 1530099779 | 41.1825374 | -8.5997959 | 3.40025
157934 | 1530099780 | 41.1825519 | -8.5998337 | 3.41673
(5 rows)
现在我想计算每个点相对于真北的bearing 变化。
但是我有这些问题我还没有找到答案:
-
根据我的阅读,我遇到了公式(如this 答案):
Bearing = atan(y,x)
其中x 和y 是数量
y = sin(Blon-Alon) * cosBlat
x = cosAlat * sinBlat -sinAlat * cosBlat * cos(Blon-Alon)
分别用于点 A 和 B。然后从另一个来源,公式 here,公式写成:
Bearing = atan2(y,x)
所以我很困惑,我应该使用哪个公式?
-
lat和lon应该在传递到数量x和y之前从度数转换为弧度。由于我的数据集中lon的值是负数,我应该取每个的绝对值吗?
【问题讨论】:
-
在您链接的第一个文件中说:
longitudinalDifference = second.longitude - first.longitude;- 这绝对是错误的(除非您当前的位置在赤道)。
标签: geolocation geospatial latitude-longitude