给定lat/long中的现有点,(以KM表示)和方位(以度数转换为弧度)的距离,我想计算新的纬度/经度.这个网站反复出现,但我无法让这个公式为我工作.
采用上述链接的公式为:
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))
Run Code Online (Sandbox Code Playgroud)
上述公式适用于MSExcel,其中 -
asin = arc sin()
d = distance (in any unit)
R = Radius of the earth (in the same unit as above)
and hence d/r = is the angular distance (in radians)
atan2(a,b) = arc tan(b/a)
? is the bearing (in radians, clockwise from north);
Run Code Online (Sandbox Code Playgroud)
这是我在Python中获得的代码.
import math
R = 6378.1 #Radius of the Earth
brng = 1.57 #Bearing is 90 degrees converted …Run Code Online (Sandbox Code Playgroud) 我正在寻找一个能够对lat/lon数据集进行空间计算的Java库.以下是我正在寻找的一些功能:
我不想要的:
该组织计划最终获得Oracle Spatial的许可证(因此,此时将覆盖空间搜索),但是现在我需要在不依赖数据库提供的空间的情况下在小数据集上实现我上面提到的分析功能.支持.
我想使用GeoDjango或GeoPy计算基于方向和距离的点.
例如,如果我有一个点(-24680.1613,6708860.65389)我想找到一个点1KM North,1KM East,1KM Sourh和1KM west使用Vincenty距离公式.
我最接近的是distance.py中的"目的地"功能(https://code.google.com/p/geopy/source/browse/trunk/geopy/distance.py?r=105).虽然我无法在任何地方找到这个记录,但我还没弄明白如何使用它.
任何帮助深表感谢.