8
8
# import custom python packages
9
9
from wahoomc .osm_maps_functions import CountryOsmData , XYOsmData
10
10
from wahoomc .osm_maps_functions import OsmMaps
11
- from wahoomc .osm_maps_functions import get_xy_coordinates_from_input
12
11
# from wahoomc.osm_maps_functions import TileNotFoundError
13
12
from wahoomc .input import InputData
14
13
from wahoomc import file_directory_functions as fd_fct
@@ -40,6 +39,13 @@ def test_calc_border_countries_input_country(self):
40
39
self .process_and_check_border_countries (
41
40
'germany' , True , expected_result , 'country' )
42
41
42
+ # germany,malta
43
+ expected_result = {'czech-republic' : {}, 'germany' : {}, 'austria' : {}, 'liechtenstein' : {},
44
+ 'switzerland' : {}, 'italy' : {}, 'netherlands' : {}, 'belgium' : {},
45
+ 'luxembourg' : {}, 'france' : {}, 'poland' : {}, 'denmark' : {}, 'sweden' : {}, 'malta' : {}}
46
+ self .process_and_check_border_countries (
47
+ 'germany,malta' , True , expected_result , 'country' )
48
+
43
49
def test_calc_border_countries_input_xy_coordinates_1tile (self ):
44
50
"""
45
51
Test initialized border countries
@@ -78,7 +84,15 @@ def test_calc_without_border_countries_input_country(self):
78
84
self .process_and_check_border_countries (
79
85
'china' , False , {'china' : {}}, 'country' )
80
86
81
- def test_calc_without_border_countries__xy_coordinates_1tile (self ):
87
+ # malta,liechtenstein
88
+ self .process_and_check_border_countries (
89
+ 'malta,liechtenstein' , False , {'malta' : {}, 'liechtenstein' : {}}, 'country' )
90
+
91
+ # malta,tunisia
92
+ self .process_and_check_border_countries (
93
+ 'malta,tunisia' , False , {'malta' : {}, 'tunisia' : {}}, 'country' )
94
+
95
+ def test_calc_without_border_countries_xy_coordinates_1tile (self ):
82
96
"""
83
97
Test initialized countries without border countries
84
98
- of one tile
@@ -89,7 +103,7 @@ def test_calc_without_border_countries__xy_coordinates_1tile(self):
89
103
self .process_and_check_border_countries (
90
104
"133/88" , False , expected_result , 'xy_coordinate' )
91
105
92
- def test_calc_without_border_countries__xy_coordinates_2tiles (self ):
106
+ def test_calc_without_border_countries_xy_coordinates_2tiles (self ):
93
107
"""
94
108
Test initialized countries without border countries
95
109
- of two tiles
@@ -146,45 +160,6 @@ def test_input_country_malta(self):
146
160
result = o_osm_data .country_name
147
161
self .assertEqual (result , 'malta' )
148
162
149
- def test_splitting_of_single_xy_coordinate (self ):
150
- """
151
- use static json files in the repo to calculate relevant tiles
152
- """
153
-
154
- xy_tuple = get_xy_coordinates_from_input ("133/88" )
155
- self .assertEqual (xy_tuple , [{"x" : 133 , "y" : 88 }])
156
-
157
- xy_tuple = get_xy_coordinates_from_input ("11/92" )
158
- self .assertEqual (xy_tuple , [{"x" : 11 , "y" : 92 }])
159
-
160
- xy_tuple = get_xy_coordinates_from_input ("138/100" )
161
- self .assertEqual (xy_tuple , [{"x" : 138 , "y" : 100 }])
162
-
163
- def test_splitting_of_multiple_xy_coordinate (self ):
164
- """
165
- use static json files in the repo to calculate relevant tiles
166
- """
167
-
168
- xy_tuple = get_xy_coordinates_from_input ("133/88,138/100" )
169
- expected_result = [{"x" : 133 , "y" : 88 }, {"x" : 138 , "y" : 100 }]
170
-
171
- self .assertEqual (xy_tuple , expected_result )
172
-
173
- # def test_get_tile_via_xy_coordinate_error(self):
174
- # """
175
- # use static json files in the repo to calculate a not-existing tile.
176
-
177
- # does not error out due to new Geofabrik Json processing. Nevertheless, the tile is not existing
178
- # only +/- 180 -/+90: https://epsg.io/4326
179
- # """
180
-
181
- # o_geofabrik = XYGeofabrik([{"x": 200, "y": 1}])
182
-
183
- # # tiles =
184
-
185
- # with self.assertRaises(TileNotFoundError):
186
- # o_geofabrik.get_tiles_of_wanted_map()
187
-
188
163
def test_encoding_open_sea_osm (self ):
189
164
"""
190
165
use static json files in the repo to calculate relevant tile
0 commit comments