-
Notifications
You must be signed in to change notification settings - Fork 123
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
index.delete requires unique ids and errors not thrown #76
Comments
@thehesiod I assume this remains an open issue - if so can I work on it? |
This is still an open issue, but I think it is a documentation one. libspatialindex indexes by bounding boxes + id, and to delete a unique record, you need to provide both. |
Yes, this makes sense because insertion of entries requires a (not necessarily unique) ID and a bounding box. It does seem strange that insertion of duplicate entries (entries with identical IDs and bounding boxes) does not throw an error - should this in fact be addressed first before the delete issue?
Why is this allowed in the first place? |
libspatialindex allows it. It is up to user applications to prevent it from happening. |
If it's a doc problem that is fine, let's get it fixed :) |
OK, I'm happy to work on it. |
I've created a PR here that clarifies the docstring for |
@hobu @thehesiod What should be done about the error/exception issue? |
That's a question for hobu |
I think documentation is sufficient. I don't think Rtree should throw an exception in this instance. It is possible users have a reason to insert duplicates, and they should protect against that themselves if they need to do so. |
per http://toblerity.org/rtree/class.html#rtree.index.Index.delete it states for the id parameter to delete:
long integer A long integer that is the identifier for this index entry. IDs need not be unique to be inserted into the index, and it is up to the user to ensure they are unique if this is a requirement.
However I tried this with with an Index which had a set of points which all had the same ids and it never removed it items. As soon as I gave each point a unique id the points got removed.
There are two bugs here:
Index_DeleteData
and throwing exception if the delete failed. Probably should go over the whole index.py file to make sure returned error codes are enforced.The text was updated successfully, but these errors were encountered: