コード例 #1
0
def test_haussdorf_densify_nan():
    actual = pygeos.hausdorff_distance(point, point, densify=np.nan)
    assert np.isnan(actual)
コード例 #2
0
def test_haussdorf_distance_empty():
    actual = pygeos.hausdorff_distance(point, empty)
    assert np.isnan(actual)
コード例 #3
0
def test_haussdorf_distance_missing():
    actual = pygeos.hausdorff_distance(point, None)
    assert np.isnan(actual)
コード例 #4
0
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)
コード例 #5
0
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)
コード例 #6
0
def test_haussdorf_distance_densify_empty():
    actual = pygeos.hausdorff_distance(point, empty, densify=0.2)
    assert np.isnan(actual)
コード例 #7
0
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)