Ejemplo n.º 1
0
 def test_tile_from_lat_lon_returns_correctly_center_tile_5(self):
     m = CubeMap(width=1536, height=1024)
     i = m.tile_from_lat_lon((radians(-80), -radians(-40))).cube_face
     self.assertEqual(5, i)
Ejemplo n.º 2
0
 def test_vector_from_xy_returns_approximately_correct_value_in_tile2(self):
     m = CubeMap(width=1536, height=1024)
     vec = m.vector_from_xy((1280, 256))
     self.assertLess(vec.x, -0.99)
     self.assertTrue(-0.01 < vec.y < 0.01, vec.y)
     self.assertTrue(-0.01 < vec.z < 0.01, vec.z)
Ejemplo n.º 3
0
 def test_tile_from_lat_lon_returns_correctly_near_tile_5_edge(self):
     m = CubeMap(width=1536, height=1024)
     i = m.tile_from_lat_lon((radians(40), -radians(50))).cube_face
     self.assertEqual(4, i)
Ejemplo n.º 4
0
 def test_tile_from_lat_lon_returns_correctly_near_center_tile_4(self):
     m = CubeMap(width=1536, height=1024)
     i = m.tile_from_lat_lon((radians(85), radians(0))).cube_face
     self.assertEqual(4, i)
Ejemplo n.º 5
0
 def test_tile_from_xy_returns_correctly5(self):
     m = CubeMap(width=1536, height=1024)
     i = m.tile_from_xy((1535, 1023))
     self.assertEqual(5, i.cube_face)
Ejemplo n.º 6
0
 def test_tile_from_xy_returns_correctly3(self):
     m = CubeMap(width=1536, height=1024)
     i = m.tile_from_xy((0, 512))
     self.assertEqual(3, i.cube_face)
Ejemplo n.º 7
0
 def test_make_arr_creates_correct_width(self):
     m = CubeMap(width=1536, height=1024)
     arr = m.make_arr(1536, 1024)
     self.assertEqual(1536, len(arr[0]))
Ejemplo n.º 8
0
 def test_cube_is_instantiated_with_correct_height(self):
     m = CubeMap(width=1536, height=1024)
     self.assertEqual(1024, m.height)
Ejemplo n.º 9
0
 def test_vector_from_xy_returns_approximately_correct_value_in_tile4(self):
     m = CubeMap(width=1536, height=1024)
     vec = m.vector_from_xy((768, 768))
     self.assertTrue(-0.01 < vec.x < 0.01)
     self.assertTrue(-0.01 < vec.y < 0.01)
     self.assertGreater(vec.z, 0.99)