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

IndexError #50

Open
drewjgray opened this issue Apr 14, 2020 · 1 comment
Open

IndexError #50

drewjgray opened this issue Apr 14, 2020 · 1 comment

Comments

@drewjgray
Copy link

Hi! This is an amazing library and I have really enjoyed working with it. I have come across an issue I haven't been able to root cause. Some of the shapefiles I have used (such as: https://geodata.lib.berkeley.edu/catalog/ark28722-s7d02x) will have an IndexError during if self._open_edges[index] == edge, where the index is -1 (calculated from index = self._index(p1, p2, edge) - 1 in the delete function of class OpenEdges. I have been unable to figure out why some shapefiles would lead to this. I have examined and cleaned the polygons closely in QGIS. Any ideas on how to overcome this?

@JvandenAssum
Copy link

Hi man, I encoutered the same problem while using polygons extracted from QGIS. self._open_edges gave an empty list sometimes.

My solution was to change the code to:
def delete(self, p1, p2, edge): index = self._index(p1, p2, edge) - 1 if self._open_edges: if self._open_edges[index] == edge: del self._open_edges[index]

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

No branches or pull requests

2 participants