Example #1
0
def test_shared_paths_none():
    assert pygeos.shared_paths(line_string, None) is None
    assert pygeos.shared_paths(None, line_string) is None
    assert pygeos.shared_paths(None, None) is None
Example #2
0
def test_shared_paths_non_linestring():
    g1 = pygeos.linestrings([(0, 0), (1, 0), (1, 1)])
    g2 = pygeos.points(0, 1)
    with pytest.raises(pygeos.GEOSException):
        pygeos.shared_paths(g1, g2)
Example #3
0
def test_shared_paths_linestring():
    g1 = pygeos.linestrings([(0, 0), (1, 0), (1, 1)])
    g2 = pygeos.linestrings([(0, 0), (1, 0)])
    actual1 = pygeos.shared_paths(g1, g2)
    assert pygeos.equals(pygeos.get_geometry(actual1, 0), g2)