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