fix error in surface position with reference
This commit is contained in:
+2
-2
@@ -427,9 +427,9 @@ def surface_position_with_ref(msg, lat_ref, lon_ref):
|
|||||||
ni = _cprNL(lat) - i
|
ni = _cprNL(lat) - i
|
||||||
|
|
||||||
if ni > 0:
|
if ni > 0:
|
||||||
d_lon = 360.0 / ni
|
d_lon = 90.0 / ni
|
||||||
else:
|
else:
|
||||||
d_lon = 360.0
|
d_lon = 90.0
|
||||||
|
|
||||||
m = util.floor(lon_ref / d_lon) \
|
m = util.floor(lon_ref / d_lon) \
|
||||||
+ util.floor(0.5 + ((lon_ref % d_lon) / d_lon) - cprlon)
|
+ util.floor(0.5 + ((lon_ref % d_lon) / d_lon) - cprlon)
|
||||||
|
|||||||
+2
-2
@@ -32,9 +32,9 @@ def test_adsb_airborne_position_with_ref():
|
|||||||
|
|
||||||
|
|
||||||
def test_adsb_surface_position_with_ref():
|
def test_adsb_surface_position_with_ref():
|
||||||
pos = adsb.surface_position_with_ref("8FC8200A3AB8F5F893096B22B4A8",
|
pos = adsb.surface_position_with_ref("8FC8200A3AB8F5F893096B000000",
|
||||||
-43.5, 172.5)
|
-43.5, 172.5)
|
||||||
assert pos == (-43.48564, 175.87195)
|
assert pos == (-43.48564, 172.53942)
|
||||||
|
|
||||||
|
|
||||||
def test_adsb_surface_position():
|
def test_adsb_surface_position():
|
||||||
|
|||||||
Reference in New Issue
Block a user