mggg / maup

The geospatial toolkit for redistricting data.
https://maup.readthedocs.io/en/latest/
MIT License
65 stars 23 forks source link

ValueError raised in maup.assign when a source geometry is fully covered by more than one target #41

Closed InnovativeInventor closed 2 years ago

InnovativeInventor commented 3 years ago

This line: https://github.com/mggg/maup/blob/933eb92d75e0b5ff7796d2b3bd067542a1d7dabd/maup/indexed_geometries.py#L48 causes ValueError: cannot reindex from a duplicate axis to be raised when a source geometry is fully covered by more than one target as it assumes that every source geometry is mapped to at most one target geometry. The solution is to remove overlaps. This is annoying to debug as the error message is very vague.

InnovativeInventor commented 3 years ago

This is a non-issue, as there is no clearly correct behavior for maup.assign when the assignment is ambiguous. However, a more descriptive error message would probably be helpful for users of maup.

dinosg commented 3 years ago

i was using these shapefiles: https://github.com/mggg-states/TX-shapefiles and fixing by maup.resolve_overlaps() got my computer hung... multiple days and it's still running :-(