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

search with distance only valid for Rtree of rectangle or point #14

Closed
davidmoten opened this issue Nov 3, 2014 · 2 comments
Closed
Labels

Comments

@davidmoten
Copy link
Owner

For example if you have

RTree<String, Circle> tree = RTree.create();
...
double maxDistance = 10;
entries = tree.search(rectangle, maxDistance);

Then the entries returned have mbrs within maxDistance rather than being exactly within maxDistance of the entry circles.

A fix for this will require an API change where the distance function is passed to the method.

@davidmoten davidmoten added the bug label Nov 3, 2014
@davidmoten
Copy link
Owner Author

a complication is that the distance function is also used against the mbr of a node as well rather than just against the entry types. Introduce a container type that the distance function operates on? E.g Rectangle is a Container of everything and a Geometry subclass is a container of itself. Then distance function defined on Container.

@davidmoten
Copy link
Owner Author

had a closer look, this is not a problem because every Geometry implementation has to implement distance to a rectangle and search with distance can only be done with a Rectangle or Point parameter (which is also a Rectangle with zero width and height).

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

1 participant