kopia lustrzana https://github.com/glidernet/ogn-python
compute sphere coordinates
rodzic
11c3377f96
commit
1d49a3417b
|
@ -1,5 +1,5 @@
|
|||
import unittest
|
||||
from ogn.ognutils import get_ddb, get_country_code
|
||||
from ogn.ognutils import get_ddb, get_country_code, wgs84_to_sphere
|
||||
from ogn.model.address_origin import AddressOrigin
|
||||
|
||||
|
||||
|
@ -33,3 +33,16 @@ class TestStringMethods(unittest.TestCase):
|
|||
longitude = -0.0009119
|
||||
country_code = get_country_code(latitude, longitude)
|
||||
self.assertEqual(country_code, None)
|
||||
|
||||
def test_wgs84_to_sphere(self):
|
||||
lat1 = 48.74435
|
||||
lon1 = 9.578
|
||||
alt1 = 929
|
||||
lat2 = 48.865
|
||||
lon2 = 9.2225
|
||||
alt2 = 574
|
||||
|
||||
[radius, theta, phi] = wgs84_to_sphere(lat1, lat2, lon1, lon2, alt1, alt2)
|
||||
self.assertAlmostEqual(radius, 29265.6035812215, 5)
|
||||
self.assertAlmostEqual(theta, 0.694979846308314, 5)
|
||||
self.assertAlmostEqual(phi, -62.604956, 5)
|
||||
|
|
Ładowanie…
Reference in New Issue