Exemplo n.º 1
0
 def test_multiline_touching_poly(self):
     np.random.seed(49)
     multiline = Multiline([10*np.random.rand(10, 2)
                            + np.random.randint(-50, 50, (1, 2)) for _ in range(50)])
     poly = Polygon([(-30, -40), (12, -30), (8, 22), (-10, 50)])
     touching = multiline.touching(poly)
     self.assertEqual(len(touching), 12)
     return
Exemplo n.º 2
0
 def test_multiline_touching_line(self):
     np.random.seed(49)
     multiline = Multiline([10*np.random.rand(10, 2)
                            + np.random.randint(-50, 50, (1, 2)) for _ in range(50)])
     line = Line([(-30, -40), (11, -30), (10, 22), (-10, 50)])
     touching = multiline.touching(line)
     self.assertEqual(len(touching), 4)
     return
Exemplo n.º 3
0
 def test_multiline_touching_poly(self):
     np.random.seed(49)
     multiline = Multiline([
         10 * np.random.rand(10, 2) + np.random.randint(-50, 50, (1, 2))
         for _ in range(50)
     ])
     poly = Polygon([(-30, -40), (12, -30), (8, 22), (-10, 50)])
     touching = multiline.touching(poly)
     self.assertEqual(len(touching), 12)
     return
Exemplo n.º 4
0
 def test_multiline_touching_line(self):
     np.random.seed(49)
     multiline = Multiline([
         10 * np.random.rand(10, 2) + np.random.randint(-50, 50, (1, 2))
         for _ in range(50)
     ])
     line = Line([(-30, -40), (11, -30), (10, 22), (-10, 50)])
     touching = multiline.touching(line)
     self.assertEqual(len(touching), 4)
     return