Results 1 to 1 of 1
- 09-02-2012, 04:09 PM #1Member
- Join Date
- Jan 2011
- Rep Power
[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 !
- By bayan in forum New To JavaReplies: 2Last Post: 04-29-2010, 10:51 AM
- By sAntA199 in forum New To JavaReplies: 8Last Post: 12-13-2009, 08:41 AM
- By busdude in forum New To JavaReplies: 0Last Post: 04-02-2009, 09:00 PM