Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_search_tiles_siberia_antimeridian(self):
"""
Tests the tile searching over Siberia and Alaska in the polar zone; ROI defined
by a 4-corner polygon over high latitudes (is much curved on the globe).
Comprises:
- do not return tiles when not intersecting the zone
- interpret correctly longitudes higher than 180 degrees
"""
grid = Equi7Grid(500)
geom_siberia_tiles = sorted(['AS500M_E066N090T6', 'AS500M_E072N090T6'])
poly_siberia_antim_180plus = setup_test_geom_siberia_antimeridian_180plus()
tiles = sorted(grid.search_tiles_in_roi(poly_siberia_antim_180plus, coverland=False))
assert sorted(tiles) == sorted(geom_siberia_tiles)
geom_siberia_alaska_tiles = sorted(['AS500M_E066N090T6', 'AS500M_E072N090T6',
'AS500M_E072N096T6',
'NA500M_E054N072T6', 'NA500M_E054N078T6',
'NA500M_E060N078T6'])
poly_siberia_alaska = setup_test_geom_siberia_alaska()
tiles = sorted(grid.search_tiles_in_roi(poly_siberia_alaska, coverland=True))
assert sorted(tiles) == sorted(geom_siberia_alaska_tiles)