def test_haussdorf_densify_nan(): actual = pygeos.hausdorff_distance(point, point, densify=np.nan) assert np.isnan(actual)
def test_haussdorf_distance_empty(): actual = pygeos.hausdorff_distance(point, empty) assert np.isnan(actual)
def test_haussdorf_distance_missing(): actual = pygeos.hausdorff_distance(point, None) assert np.isnan(actual)
def test_haussdorf_distance_densify(): # example from GEOS docs a = pygeos.linestrings([[0, 0], [100, 0], [10, 100], [10, 100]]) b = pygeos.linestrings([[0, 100], [0, 10], [80, 10]]) actual = pygeos.hausdorff_distance(a, b, densify=0.001) assert actual == pytest.approx(47.8, abs=0.1)
def test_haussdorf_distance(): # example from GEOS docs a = pygeos.linestrings([[0, 0], [100, 0], [10, 100], [10, 100]]) b = pygeos.linestrings([[0, 100], [0, 10], [80, 10]]) actual = pygeos.hausdorff_distance(a, b) assert actual == pytest.approx(22.360679775, abs=1e-7)
def test_haussdorf_distance_densify_empty(): actual = pygeos.hausdorff_distance(point, empty, densify=0.2) assert np.isnan(actual)
def test_hausdorff_distance_missing(): actual = pygeos.hausdorff_distance(point, None) assert np.isnan(actual) actual = pygeos.hausdorff_distance(point, None, densify=0.001) assert np.isnan(actual)