def test_connected_multipoint_nearest_on_boundary4(self): line = Line([(-20.0, 32.0), (-26.0, 43.0), (-38.0, 39.0)], crs=LonLatWGS84) npt = line.nearest_on_boundary(Point((-34.0, 52.0), crs=LonLatWGS84)) self.assertPointAlmostEqual( npt, Point((-27.98347, 42.456316), crs=LonLatWGS84)) return
def test_connected_multipoint_nearest_on_boundary(self): line = Line([(0.0, 0.0), (2.0, 2.0), (5.0, 4.0)]) npt = line.nearest_on_boundary(Point((0.0, 2.0))) self.assertEqual(npt, Point((1.0, 1.0))) return
def test_connected_multipoint_nearest_on_boundary2(self): line = Line([(-40, 0.0), (35, 0.0)], crs=LonLatWGS84) npt = line.nearest_on_boundary(Point((30.0, 80.0), crs=LonLatWGS84)) self.assertPointAlmostEqual(npt, Point((30.0, 0.0), crs=LonLatWGS84)) return
def test_connected_multipoint_nearest_on_boundary3(self): # This is the test that tends to break naive root finding schemes line = Line([(-40, 0.0), (35, 0.0)], crs=LonLatWGS84) npt = line.nearest_on_boundary(Point((30.0, 1e-8), crs=LonLatWGS84)) self.assertPointAlmostEqual(npt, Point((30.0, 0.0), crs=LonLatWGS84)) return
def test_connected_multipoint_nearest_on_boundary4(self): line = Line([(-20.0, 32.0), (-26.0, 43.0), (-38.0, 39.0)], crs=LonLatWGS84) npt = line.nearest_on_boundary(Point((-34.0, 52.0), crs=LonLatWGS84)) self.assertPointAlmostEqual(npt, Point((-27.98347, 42.456316), crs=LonLatWGS84)) return