Results 1 to 1 of 1
- 09-02-2012, 05:09 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 5
- Rep Power
- 0
[Performance Question] Finding rectangle where point is = R-Tree ?
Hello there. Googly problem:
Lets supose i have a List<Rectangle> witch has 2k rectangles. Every rectangle ha different X,Y however i can have 1 rectangle inside another (and you cannot have 1 inside the one whos inside the 'main' rectangle, so a rectangle can have a parent but not a 'post-parent')
When i give a Point to search with my starting algorithm, and i want to know witch rectangles this point is in, i have to read all rectangles in the list to know witch rectangles this point is.
Also, when i create another rectangle, i have to check if this rectangle is bounding another rectangle , cause rectangles cannot have theyr border crossing, and there is a max. distance between rectangles.This image shows how those rectangles looks like:
I wonder if someone knows something about how this could be done performatically. Some people recommended an R-Tree but im not soure how could i use it, ive got a few examples but i couldnt manage to run the tree.
Would apreciate any effort tryng to help
Thanks alot for thy attention !
Similar Threads
-
Checking if a point is in a rectangle
By bayan in forum New To JavaReplies: 2Last Post: 04-29-2010, 11:51 AM -
Finding the closest point in a list of points
By sAntA199 in forum New To JavaReplies: 8Last Post: 12-13-2009, 09:41 AM -
Finding distance from a point to a Rectangle2D.objecy
By busdude in forum New To JavaReplies: 0Last Post: 04-02-2009, 10:00 PM
Bookmarks