示例#1
0
def test_segmentize(geometry, tolerance, expected):
    actual = pygeos.segmentize(geometry, tolerance)
    assert pygeos.equals(actual, geometry).all()
示例#2
0
def test_segmentize_none():
    assert pygeos.segmentize(None, tolerance=5) is None
示例#3
0
def test_segmentize_tolerance_nan(geometry):
    actual = pygeos.segmentize(geometry, tolerance=np.nan)
    assert actual is None
示例#4
0
def test_segmentize_no_change(geometry):
    actual = pygeos.segmentize(geometry, tolerance=5)
    assert pygeos.equals(actual, geometry).all()
示例#5
0
def test_segmentize_invalid_tolerance(geometry, tolerance):
    with pytest.raises(GEOSException, match="IllegalArgumentException"):
        pygeos.segmentize(geometry, tolerance=tolerance)