Efficient AI4EO OpenSource framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
840B

  1. import unittest
  2. import mercantile
  3. from neat_eo.tiles import tiles_from_dir, tiles_from_csv
  4. class TestSlippyMapTiles(unittest.TestCase):
  5. def test_slippy_map_directory(self):
  6. root = "tests/fixtures/images"
  7. tiles = [(tile, path) for tile, path in tiles_from_dir(root, xyz_path=True)]
  8. tiles.sort()
  9. self.assertEqual(len(tiles), 3)
  10. tile, path = tiles[0]
  11. self.assertEqual(type(tile), mercantile.Tile)
  12. self.assertEqual(path, "tests/fixtures/images/18/69105/105093.jpg")
  13. class TestReadTiles(unittest.TestCase):
  14. def test_read_tiles(self):
  15. filename = "tests/fixtures/tiles.csv"
  16. tiles = [tile for tile in tiles_from_csv(filename)]
  17. tiles.sort()
  18. self.assertEqual(len(tiles), 3)
  19. self.assertEqual(tiles[1], mercantile.Tile(69623, 104945, 18))