deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.io.quadtree
Class MemPointQuadtree<T>

java.lang.Object
  extended by org.deegree.io.quadtree.MemPointQuadtree<T>
Type Parameters:
T - the datatype to be used as id
All Implemented Interfaces:
Quadtree<T>

public class MemPointQuadtree<T>
extends Object
implements Quadtree<T>

MemPointQuadtree is a memory based quadtree implementation for points.

Since:
2.0
Version:
2.0, $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Andreas Schmitz, last edited by: $Author: mschneider $

Field Summary
(package private)  int maxDepth
           
 
Constructor Summary
MemPointQuadtree(Envelope region)
          Creates a new instance with the specified region.
MemPointQuadtree(Envelope region, double accuracyX, double accuracyY)
          Creates a new instance with the specified region.
 
Method Summary
 void deleteItem(T item)
          Deletes the item from the quadtree.
 void deleteRange(Envelope envelope)
          Deletes all items intersecting the envelope.
 int getDepth()
           
 Envelope getRootBoundingBox()
          returns the bounding box covered by the quadtrees root node
 void insert(T item, Envelope envelope)
          Inserts the item with the envelope into the quadtree.
 void insert(T item, Point point)
          Inserts the item with the given point as envelope.
 List<T> query(Envelope envelope)
          Searches for all items intersecting with the envelope.
 void update(T item, Envelope newBBox)
          updates spacial index of the specified item in the quadtree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxDepth

int maxDepth
Constructor Detail

MemPointQuadtree

public MemPointQuadtree(Envelope region)
Creates a new instance with the specified region. This envelope cannot be changed.

Parameters:
region -

MemPointQuadtree

public MemPointQuadtree(Envelope region,
                        double accuracyX,
                        double accuracyY)
Creates a new instance with the specified region. This envelope cannot be changed.

Parameters:
region -
accuracyX -
accuracyY -
Method Detail

insert

public void insert(T item,
                   Envelope envelope)
            throws IndexException
Inserts the item with the envelope into the quadtree.

Specified by:
insert in interface Quadtree<T>
Parameters:
item -
envelope -
Throws:
IndexException

insert

public void insert(T item,
                   Point point)
            throws IndexException
Inserts the item with the given point as envelope.

Specified by:
insert in interface Quadtree<T>
Parameters:
item -
point -
Throws:
IndexException

query

public List<T> query(Envelope envelope)
              throws IndexException
Searches for all items intersecting with the envelope.

Specified by:
query in interface Quadtree<T>
Parameters:
envelope -
Returns:
a list with the resulting items
Throws:
IndexException

deleteItem

public void deleteItem(T item)
                throws IndexException
Deletes the item from the quadtree. Untested method!

Specified by:
deleteItem in interface Quadtree<T>
Parameters:
item - the item to be deleted
Throws:
IndexException

deleteRange

public void deleteRange(Envelope envelope)
Deletes all items intersecting the envelope. Untested method!

Specified by:
deleteRange in interface Quadtree<T>
Parameters:
envelope -
See Also:
)

getDepth

public int getDepth()
Specified by:
getDepth in interface Quadtree<T>
Returns:
the deepest level of this subtree

getRootBoundingBox

public Envelope getRootBoundingBox()
                            throws IndexException
Description copied from interface: Quadtree
returns the bounding box covered by the quadtrees root node

Specified by:
getRootBoundingBox in interface Quadtree<T>
Returns:
the root bounding box
Throws:
IndexException

update

public void update(T item,
                   Envelope newBBox)
Description copied from interface: Quadtree
updates spacial index of the specified item in the quadtree.

Specified by:
update in interface Quadtree<T>
Parameters:
item - the ID of the item.
newBBox - the new BBoundingbox of the item.

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org