-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
24 lines (18 loc) · 745 Bytes
/
test.py
File metadata and controls
24 lines (18 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from lib.intersection_calculate import cross_location_nearest
from geopy import distance
# target = [116.353389, 39.959431]
#
# dat1 = (116.353602, 39.958594, -3.889)
# dat2 = (116.354082, 39.958841, -44.555)
# dat3 = (116.353665, 39.959535, -98.267)
target = [116.353321, 39.958606]
dat1 = (116.354447, 39.958292, -72.303)
dat2 = (116.354733, 39.959414, -124.521)
dat3 = (116.354228, 39.959731, -147.784)
inter1 = cross_location_nearest(dat1, dat2)
inter2 = cross_location_nearest(dat1, dat3)
inter3 = cross_location_nearest(dat2, dat3)
localized = [(inter1[i]+inter2[i]+inter3[i])/3 for i in range(2)]
print('Target:', target)
print('Result:', localized)
print(distance.great_circle((target[1], target[0]), (localized[1], localized[0])))