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

Unique/hashable ID for each RTreeNode #84

Open
giorgostheo opened this issue Jan 20, 2022 · 2 comments
Open

Unique/hashable ID for each RTreeNode #84

giorgostheo opened this issue Jan 20, 2022 · 2 comments

Comments

@giorgostheo
Copy link

From what I have seen, the current RTreeNode implementation does not offer a unique (hashable, implements == correctly) key for each RTreeNode.

More specifically, I believe there are many usecases where one might need some sort of internal "access" to the node, meaning a way to add some sort of data to each one. In my case, this "data" is a tuple of values. However, since there is nothing correctly hashable in each RTreeNode, I can not find a way to create a Hashmap for ex. in order to store the data I need. The only info that is always available for each RTreeNode is the envelope, however two nodes can have the same envelope which means that this is not an appropriate key.

Adding some way to extract a (preferably hashable) unique ID for each RTreeNode would be useful in many ways, since it can allow a more "free" approach to traversal and can also allow child to parent referances instead of just parent to child.

@urschrei
Copy link
Member

a way to add some sort of data to each one

Does https://docs.rs/rstar/latest/rstar/primitives/struct.GeomWithData.html work for this?

@giorgostheo
Copy link
Author

giorgostheo commented Jan 20, 2022

No, the data needs to be added to each RTreeNode not to each individual point.

Additionally, adding EQ support to each to RTreeNode would proly be enough, even though hash would be better. I dont know if that is doable thought...

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