[test] add get_latlng_to_pixel_coordinates test
Browse files
tests/events/get_latlng_to_pixel_coordinates.json
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"europe": {
|
3 |
+
"input": {
|
4 |
+
"latlng_origin_ne": {
|
5 |
+
"lat": 39.00211112813057,
|
6 |
+
"lng": 15.047197603420843
|
7 |
+
},
|
8 |
+
"latlng_origin_sw": {
|
9 |
+
"lat": 38.26837671763853,
|
10 |
+
"lng": 13.640947603420843
|
11 |
+
},
|
12 |
+
"latlng_current_point": {
|
13 |
+
"lat": 38.48902081116029,
|
14 |
+
"lng": 14.93651187728213
|
15 |
+
},
|
16 |
+
"zoom": 10,
|
17 |
+
"k": "point"
|
18 |
+
},
|
19 |
+
"output": {
|
20 |
+
"x": 943,
|
21 |
+
"y": 480
|
22 |
+
}
|
23 |
+
},
|
24 |
+
"north_america": {
|
25 |
+
"input": {
|
26 |
+
"latlng_origin_ne": {
|
27 |
+
"lat": 49.582282020151446,
|
28 |
+
"lng": -114.91703409765535
|
29 |
+
},
|
30 |
+
"latlng_origin_sw": {
|
31 |
+
"lat": 44.465212628469644,
|
32 |
+
"lng": -126.16703409765536
|
33 |
+
},
|
34 |
+
"latlng_current_point": {
|
35 |
+
"lat": 45.80744471451486,
|
36 |
+
"lng": -115.76956041946815
|
37 |
+
},
|
38 |
+
"zoom": 7,
|
39 |
+
"k": "point"
|
40 |
+
},
|
41 |
+
"output": {
|
42 |
+
"x": 947,
|
43 |
+
"y": 511
|
44 |
+
}
|
45 |
+
},
|
46 |
+
"south_america": {
|
47 |
+
"input": {
|
48 |
+
"latlng_origin_ne": {
|
49 |
+
"lat": -25.977795571234143,
|
50 |
+
"lng": -61.78714474717111
|
51 |
+
},
|
52 |
+
"latlng_origin_sw": {
|
53 |
+
"lat": -32.52828619080139,
|
54 |
+
"lng": -73.03714474717113
|
55 |
+
},
|
56 |
+
"latlng_current_point": {
|
57 |
+
"lat": -30.50591463444477,
|
58 |
+
"lng": -62.94729295042129
|
59 |
+
},
|
60 |
+
"zoom": 7,
|
61 |
+
"k": "point"
|
62 |
+
},
|
63 |
+
"output": {
|
64 |
+
"x": 919,
|
65 |
+
"y": 469
|
66 |
+
}
|
67 |
+
|
68 |
+
},
|
69 |
+
"oceania": {
|
70 |
+
"input": {
|
71 |
+
"latlng_origin_ne": {
|
72 |
+
"lat": -1.4939713066293112,
|
73 |
+
"lng": 155.30273437500003
|
74 |
+
},
|
75 |
+
"latlng_origin_sw": {
|
76 |
+
"lat": -52.32191088594772,
|
77 |
+
"lng": 65.30273437500001
|
78 |
+
},
|
79 |
+
"latlng_current_point": {
|
80 |
+
"lat": -41.90533741995158,
|
81 |
+
"lng": 146.54890054574847
|
82 |
+
},
|
83 |
+
"zoom": 4,
|
84 |
+
"k": "point"
|
85 |
+
},
|
86 |
+
"output": {
|
87 |
+
"x": 924,
|
88 |
+
"y": 509
|
89 |
+
}
|
90 |
+
}
|
91 |
+
}
|
tests/io/test_coordinates_pixel_conversion.py
CHANGED
@@ -1,13 +1,16 @@
|
|
1 |
import json
|
2 |
from unittest import TestCase
|
3 |
|
4 |
-
from src.io.coordinates_pixel_conversion import get_latlng2pixel_projection, get_point_latlng_to_pixel_coordinates
|
|
|
|
|
5 |
from tests import TEST_EVENTS_FOLDER
|
6 |
|
7 |
|
8 |
names_fn_dict = {
|
9 |
"get_latlng2pixel_projection": get_latlng2pixel_projection,
|
10 |
-
"get_point_latlng_to_pixel_coordinates": get_point_latlng_to_pixel_coordinates
|
|
|
11 |
}
|
12 |
|
13 |
|
@@ -29,8 +32,5 @@ class Test(TestCase):
|
|
29 |
def test_get_point_latlng_to_pixel_coordinates(self):
|
30 |
test_fn_reading_json_inputs_outputs("get_point_latlng_to_pixel_coordinates")
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
#
|
35 |
-
# def test_pixel_coordinate(self):
|
36 |
-
# self.fail()
|
|
|
1 |
import json
|
2 |
from unittest import TestCase
|
3 |
|
4 |
+
from src.io.coordinates_pixel_conversion import get_latlng2pixel_projection, get_point_latlng_to_pixel_coordinates, \
|
5 |
+
get_latlng_to_pixel_coordinates
|
6 |
+
|
7 |
from tests import TEST_EVENTS_FOLDER
|
8 |
|
9 |
|
10 |
names_fn_dict = {
|
11 |
"get_latlng2pixel_projection": get_latlng2pixel_projection,
|
12 |
+
"get_point_latlng_to_pixel_coordinates": get_point_latlng_to_pixel_coordinates,
|
13 |
+
"get_latlng_to_pixel_coordinates": get_latlng_to_pixel_coordinates
|
14 |
}
|
15 |
|
16 |
|
|
|
32 |
def test_get_point_latlng_to_pixel_coordinates(self):
|
33 |
test_fn_reading_json_inputs_outputs("get_point_latlng_to_pixel_coordinates")
|
34 |
|
35 |
+
def test_get_latlng_to_pixel_coordinates(self):
|
36 |
+
test_fn_reading_json_inputs_outputs("get_latlng_to_pixel_coordinates")
|
|
|
|
|
|