some bugs about Quadtree

2008-10-05
2013-05-30
  • Garfiled1978
    Garfiled1978
    2008-10-05

    Hi,

    Currently, I am trying to use Quadtree to store some Envelopes and then do some query to find the Envelopes which fall in some specific Envelope.

    But  I can not get the results correctly.

    The code would be like:

    class A {
      static Quadtree spindex;
    ....................

       void test(){
          while(){
             Envelope env = new Envelope(new Coordinate(...)) ;
             spindex.insert(env);
             ................
          }
       }

       ArrayList get(){
           return (ArrayList)spindex.query() ; 
       }
    }

    class B implement Runnable {
        void run(){
            A a  ;
           a.test() ;
           a.get();

          // Question: Even there is some points alread inserted in to spindex, I can not get the results properly. I want to know why.

    }

    I do not know if anyone else encountered this problem.