Exemple #1
0
 def test_many_points(self):
     lons = numpy.array([0.7, 0.6, 0.4, 0.6, 0.3, 0.9, 0.5, 0.4])
     lats = numpy.array([0.8, 0.5, 0.2, 0.7, 0.2, 0.4, 0.9, 0.4])
     mesh = Mesh(lons, lats, None)
     polygon = mesh.get_convex_hull()
     elons = [0.4, 0.3, 0.5, 0.7, 0.9]
     elats = [0.2, 0.2, 0.9, 0.8, 0.4]
     numpy.testing.assert_allclose(polygon.lons, elons)
     numpy.testing.assert_allclose(polygon.lats, elats)
Exemple #2
0
 def test_many_points(self):
     lons = numpy.array([0.7, 0.6, 0.4, 0.6, 0.3, 0.9, 0.5, 0.4])
     lats = numpy.array([0.8, 0.5, 0.2, 0.7, 0.2, 0.4, 0.9, 0.4])
     mesh = Mesh(lons, lats, None)
     polygon = mesh.get_convex_hull()
     elons = [0.4, 0.3, 0.5, 0.7, 0.9]
     elats = [0.2, 0.2, 0.9, 0.8, 0.4]
     numpy.testing.assert_allclose(polygon.lons, elons)
     numpy.testing.assert_allclose(polygon.lats, elats)
Exemple #3
0
 def test_two_points(self):
     mesh = Mesh(numpy.array([-10., -11.]), numpy.array([-12., -13.]), None)
     polygon = mesh.get_convex_hull()
     self.assertIsInstance(polygon, Polygon)
     elons = [-10.99996704, -11.0000323, -11.00003296, -10.00003295,
              -9.99996795, -9.99996705]
     elats = [-13.00003147, -13.00003212, -12.99996853, -11.99996865,
              -11.99996776, -12.00003135]
     numpy.testing.assert_allclose(polygon.lons, elons)
     numpy.testing.assert_allclose(polygon.lats, elats)
Exemple #4
0
 def test_two_points(self):
     mesh = Mesh(numpy.array([-10., -11.]), numpy.array([-12., -13.]), None)
     polygon = mesh.get_convex_hull()
     self.assertIsInstance(polygon, Polygon)
     elons = [
         -10.99996704, -11.0000323, -11.00003296, -10.00003295, -9.99996795,
         -9.99996705
     ]
     elats = [
         -13.00003147, -13.00003212, -12.99996853, -11.99996865,
         -11.99996776, -12.00003135
     ]
     numpy.testing.assert_allclose(polygon.lons, elons)
     numpy.testing.assert_allclose(polygon.lats, elats)