Strange problem with QuadTree

47 views
Skip to first unread message

huz

unread,
Dec 13, 2011, 10:11:34 AM12/13/11
to NetTopologySuite
I have used NuGet to install 1.11 version into my project.

I have created QuadTree:
var QuadTree = new Quadtree<MyGeometry>();

Then inserted bunch of objects
QuadTree.Insert(new NTRect(r.Coordinates.GetBounds()), r);

where NTRect : IEnvelope
(I have implemented only members which trew NotImplementedException on
run:
Minx, MaxX, MinY, MaxY, Width and Height)

And when i run query for some bounds I get objects required but I also
get all objects which intersect with some other rectangles. It looks
like that I get all objects that intersect with bounds of all parent
rectangles that build QuadTree structure above my search rectangle
because they all contain my NTRect provided in search, and they
increase in size until left half of my dataset area. I get only
objects on bounds of this rectangles, not the one inside.

Is this some lib bug, or my? What should I do next? Can I download
debug version of NetTopologySuite .dlls?

Diego Guidi

unread,
Dec 13, 2011, 10:17:54 AM12/13/11
to nettopol...@googlegroups.com
>Is this some lib bug, or my? What should I do next? 
>Can I download debug version of NetTopologySuite .dlls? 
You can grab the source code from svn:

FObermaier

unread,
Dec 21, 2011, 10:34:08 AM12/21/11
to NetTopologySuite
Did you get along with compiling NTS yourself. Did you find any bugs
in the quadtree implementation. If so, please report with a sample
dataset/testcase.
cheers
FObermaier

FObermaier

unread,
Dec 22, 2011, 3:42:47 AM12/22/11
to NetTopologySuite
I did a quick check and found out you are right.
Just calling the Query(Envelope) method returns more than the really
intersecting objects.
But the code docs state that clearly:
"Precisely, the items that are returned are all items in the tree
whose envelope <b>may</b> intersect the search Envelope.
Note that some items with non-intersecting envelopes may be returned
as well;
the client is responsible for filtering these out."
Reply all
Reply to author
Forward
0 new messages