import pytest import h06_web_mercator_utils as H06 class TestH06WebMercatorUtils: def test_latlon_to_tile(self): # Ukraine typical coords x, y = H06.latlon_to_tile(50.4501, 30.5234, 19) assert x > 0 assert y > 0 def test_tile_to_latlon(self): x, y, zoom = 305000, 175000, 19 lat, lon = H06.tile_to_latlon(x, y, zoom) assert -90 <= lat <= 90 assert -180 <= lon <= 180 def test_compute_tile_bounds(self): bounds = H06.compute_tile_bounds(305000, 175000, 19) assert "nw" in bounds assert "se" in bounds assert "gsd" in bounds # GSD at zoom 19 in mid-latitudes should be roughly 0.15 to 0.4 m/px assert 0.15 < bounds["gsd"] < 0.4