Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionFailedException: found two shells in EdgeRing list #2029

Open
hmy930303 opened this issue Mar 26, 2024 · 1 comment
Open

AssertionFailedException: found two shells in EdgeRing list #2029

hmy930303 opened this issue Mar 26, 2024 · 1 comment
Labels

Comments

@hmy930303
Copy link

hmy930303 commented Mar 26, 2024

Please note

Expected behavior and actual behavior.

Expected unary_union successfully

Steps to reproduce the problem.

it happens when i use shapely union operation (unary_union()), all of all geoms is_valid is True. But sometime when i use set operation such as result = list(set(geoms_list)) , seems to make random order , the unary_union(result) runs successfully.

Code

import shapely
from shapely.ops import unary_union

def test_unary_union():
    # copy all datas from upload text file to here
    datas_string = "copy to here"
    geoms_data = [shapely.wkt.loads(geom_wkt) for geom_wkt in datas_string.split("\t")]
    # all geoms are valid
    assert all([geom.is_valid for geom in geoms_data])
    # this operation will raise error, i don't know why
    union = unary_union(geoms_data)
    # after set operation, the unary_union runs successfully (maybe random the order of geoms, the count of geoms is the same)
    new_geoms = list(set(geoms_data))
    union = unary_union(new_geoms)

Data

data.txt

Operating system

Ubuntu 22.04

Shapely version and provenance

2.0.2 with pip install GEOS ersion: 3.11.1

@theroggy
Copy link
Contributor

I cannot reproduce the problem using geos 3.12.1, so most likely it has been solved.

You could try with shapely 2.0.3, which includes geos 3.11.3. geos 3.11.3 contains most of the same bugfixes as geos 3.12.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants