Exemplo n.º 1
0
 def test_tileslist(self):
     mb = TilesManager()
     # World at level 0
     l = mb.tileslist((-180.0, -90.0, 180.0, 90.0), [0])
     self.assertEqual(l, [(0, 0, 0)])
     # World at levels [0, 1]
     l = mb.tileslist((-180.0, -90.0, 180.0, 90.0), [0, 1])
     self.assertEqual(l, [(0, 0, 0),
                          (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1)])
     # Incorrect bounds
     self.assertRaises(InvalidCoverageError, mb.tileslist, (-91.0, -180.0), [0])
     self.assertRaises(InvalidCoverageError, mb.tileslist, (-90.0, -180.0, 180.0, 90.0), [])
     self.assertRaises(InvalidCoverageError, mb.tileslist, (-91.0, -180.0, 180.0, 90.0), [0])
     self.assertRaises(InvalidCoverageError, mb.tileslist, (-91.0, -180.0, 181.0, 90.0), [0])
     self.assertRaises(InvalidCoverageError, mb.tileslist, (-90.0, 180.0, 180.0, 90.0), [0])
     self.assertRaises(InvalidCoverageError, mb.tileslist, (-30.0, -90.0, -50.0, 90.0), [0])
Exemplo n.º 2
0
 def test_tileslist(self):
     mb = TilesManager()
     # World at level 0
     l = mb.tileslist((-180.0, -90.0, 180.0, 90.0), [0])
     self.assertEqual(l, [(0, 0, 0)])
     # World at levels [0, 1]
     l = mb.tileslist((-180.0, -90.0, 180.0, 90.0), [0, 1])
     self.assertEqual(l, [(0, 0, 0),
                          (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1)])
     # Incorrect bounds
     self.assertRaises(InvalidCoverageError, mb.tileslist, (-91.0, -180.0), [0])
     self.assertRaises(InvalidCoverageError, mb.tileslist, (-90.0, -180.0, 180.0, 90.0), [])
     self.assertRaises(InvalidCoverageError, mb.tileslist, (-91.0, -180.0, 180.0, 90.0), [0])
     self.assertRaises(InvalidCoverageError, mb.tileslist, (-91.0, -180.0, 181.0, 90.0), [0])
     self.assertRaises(InvalidCoverageError, mb.tileslist, (-90.0, 180.0, 180.0, 90.0), [0])
     self.assertRaises(InvalidCoverageError, mb.tileslist, (-30.0, -90.0, -50.0, 90.0), [0])
Exemplo n.º 3
0
    def test_tileslist_at_z1_x0_y0_tms(self):
        mb = TilesManager()
        l = mb.tileslist((-180.0, 1, -1, 90.0), [1], scheme='tms')

        self.assertEqual(l, [(1, 0, 1)])
Exemplo n.º 4
0
 def test_tileslist_at_z1_x0_y0(self):
     mb = TilesManager()
     l = mb.tileslist((-180.0, 1, -1, 90.0), [1])
     self.assertEqual(l, [(1, 0, 0)])
Exemplo n.º 5
0
    def test_tileslist_at_z1_x0_y0_tms(self):
        mb = TilesManager()
        l = mb.tileslist((-180.0, 1, -1, 90.0), [1], scheme='tms')

        self.assertEqual(l, [(1, 0, 1)])
Exemplo n.º 6
0
 def test_tileslist_at_z1_x0_y0(self):
     mb = TilesManager()
     l = mb.tileslist((-180.0, 1, -1, 90.0), [1])
     self.assertEqual(l, [(1, 0, 0)])