Geodesic.WGS84.Inverse通过两点经纬度计算两点间的方位角

两个经纬度查距离等叫反向
Geodesic.WGS84.Inverse(-41.32, 120.733523, 40.96, -5.50)


出发地经纬度加方位角和距离,查目的地经纬度叫正向
Geodesic.WGS84.Direct(30.773926, 126.25757, 0, 20000)

 

一开始觉得Geodesic.WGS84.Inverse得出的方位角奇怪,azi1与azi2差不多,35.7/36.3,这个方位角与我的理解不同,

 

注意43, 125.0与44, 126.0之间的连线没有问题,但125与126两条经线不是平行的,所以导致连线的方位角在两点不相同,

这里需要把连线当成矢量,azi1与azi2的大方向都是从1点出发朝2点的方向,不是我想的azi1时从1到2的方向,azi2是从2到1的方向。

后来我又颠倒了两个点的顺序,结果发现从1到2点的azi2 等于 从2到1点的azi1的180度反方向。

所以我可以用azi2+180表示反向的方位角。

 

 

Geodesic.WGS84.Inverse(43, 125.0, 44, 126.0)
{'lat1': 43, 'lon1': 125.0, 'lat2': 44, 'lon2': 126.0, 'a12': 1.2366466863602819, 's12': 137419.4495999654, 'azi1': 35.70945216023207, 'azi2': 36.39784223561479}
Geodesic.WGS84.Inverse(44, 126.0, 43, 125.0)
{'lat1': 44, 'lon1': 126.0, 'lat2': 43, 'lon2': 125.0, 'a12': 1.2366466863602819, 's12': 137419.4495999654, 'azi1': -143.6021577643852, 'azi2': -144.29054783976792}

 

 

 

另一个方法是通过角度和距离计算目标的经纬度:

 

Direct(lat1, lon1, azi1, s12, outmask=1929)[source]

Solve the direct geodesic problem

Parameters:
  • lat1 – latitude of the first point in degrees
  • lon1 – longitude of the first point in degrees
  • azi1 – azimuth at the first point in degrees
  • s12 – the distance from the first point to the second inmeters
  • outmask – the output mask
Returns:

a Geodesic dictionary

Compute geodesic starting at (lat1, lon1) with azimuth azi1and length s12. The default value of outmask is STANDARD, i.e.,the lat1, lon1, azi1, lat2, lon2, azi2, s12, a12entries are returned.

Geodesic.WGS84.Direct(42.63055, 126.25757, 30, 100)
{'lat1': 42.63055, 'lon1': 126.25757, 'azi1': 30.0, 's12': 100, 'a12': 0.0008999523621324253, 'lat2': 42.63132960059242, 'lon2': 126.25817955704002, 'azi2': 30.00041283674731}
                mrpoint = Geodesic.WGS84.Direct(42.63055, 126.25757, delta + theta, d)
                gcj = wgs84togcj02(mrpoint['lon2'], mrpoint['lat2'])

 

 

 

GeographicLib API

https://geographiclib.sourceforge.io/html/python/code.html#geographiclib.geodesic.Geodesic.LONG_UNROLL

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值