如何找到具有给定经纬度值和距离的点的经纬度
我有一个点A(52.132781727864,-106,63492619991302)。从 A 点,我想获取 B 点的经纬度,B 点位于 A 点以南 5 公里处。
我怎样才能获得 B 点的经纬度?我正在用 Java 编码。
编辑:如果该点位于东南部,我该怎么办?
I have a point A (52.132781727864, -106,63492619991302). From point A i would like to get the lat, long of point B which is 5 km South from point A.
How can I get the the lat long of point B? I'm coding in Java.
Edit: If the point is in South-East what should I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
5 公里的角度 = ((5 / (6371 * pi)) * 180) = 0.0449660803。应从纬度中减去该数字。经度保持不变。
附言。感谢 Carlos Heuberger 的更正。
5km in angles = ((5 / (6371 * pi)) * 180) = 0.0449660803. This number should be subtracted from the latitude. Longitude remains same.
PS. Thanks to Carlos Heuberger for correction.
http://en.wikipedia.org/wiki/Great-circle_distance
http://en.wikipedia.org/wiki/Great-circle_distance
我强烈建议使用 GeoTools 来处理地球表面几何形状,因为它将地球视为椭球体(地球不是一个完美的球体)。特别是查看 GeodeticCalculator,您可以在其中设置起始位置和方向(方位角和距离),然后获取目的地位置。
I highly recommend using GeoTools for earth surface geometry, as it factors in the earth as an ellipsoid (the earth is not a perfect sphere). In particular take a look at GeodeticCalculator where you set the starting position and direction (azimuth and distance) and then get the destination position.
将问题扩展为“如何找到具有给定经纬度值、距离和方向的点的经纬度”,这里是较短距离(小于约 1000 公里)的近似值,
其中:
-
lat1
和lon1
- 起始坐标(北和东为正)-
dist
- 以公里为单位的距离-
dir
- 起始方向(2)-
lat2
和lon2
- 所得坐标(1) 假设球形地球模型
(2)
dir = 135°
为东南基于 Astrosail - Mittelbreitenverfahren
Extending the question to "How can I find lat long of a point with a given lat long value, distance and direction", here an approximation for shorter distances (less than about 1000 km)
Where:
-
lat1
andlon1
- the starting coordinates (North and East are positive)-
dist
- the distance in kilometers-
dir
- the starting direction (2)-
lat2
andlon2
- the resulting coordinates(1) assuming the spherical earth model
(2)
dir = 135°
for South-Eastbased on Astrosail - Mittelbreitenverfahren
我有一段时间也遇到了同样的问题。由于在我的例子中,原始数据是UTM,产品只需在给定区域中工作,并且添加的距离不是很大,我所要做的就是计算正弦和余弦,并将东移和北移添加到初始数据中。波普
I had the same problem a little time along. Since in my case the original data was in UTM, the product only had to work in a given zone, and the distance to add was not very big, all I had to do was calculating sinus and cosinus and adding easting and northing to the initial poing