deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.commons.index
Class RTree<T>

java.lang.Object
  extended by org.deegree.commons.index.SpatialIndex<T>
      extended by org.deegree.commons.index.RTree<T>
Type Parameters:
T - of objects the tree will hold.

public class RTree<T>
extends SpatialIndex<T>

RTree Query will return the Objects of the index

The bulk insertion mechanism is an implementation of STRTree: Scott T. Leutenegger, Jeffrey M. Edgington, Mario A. Lopez: STR: A SIMPLE AND EFFICIENT ALGORITHM FOR R-TREE PACKING (1997)

Version:
$Revision: 21920 $, $Date: 2010-01-13 11:52:29 +0100 (Mi, 13 Jan 2010) $
Author:
Andreas Schmitz, last edited by: $Author: aschmitz $

Nested Class Summary
(package private) static class RTree.Entry<T>
           
 
Field Summary
(package private)  boolean outputWarning
           
 
Constructor Summary
RTree(Envelope rootEnvelope, int numberOfObjects)
           
RTree(InputStream is)
          Rereads this RTree from a serialized file to which is should point.
 
Method Summary
 void clear()
          Removes all objects from this spatial index.
 boolean getExtraFlag()
           
 boolean insert(Envelope envelope, T object)
          Add the given object to the spatial index using the given boundingbox
 void insertBulk(List<Pair<Envelope,T>> listOfObjects)
          Builds the index from the given objects with their envelope.
 LinkedList<T> query(Envelope env)
          Query the spatial index with the given envelope and return all objects which intersect with the given boundingbox.
 boolean remove(T object)
          Removes the given object from this spatial index, using the objects' equals method.
 void write(RandomAccessFile output, boolean extraFlag)
           
 
Methods inherited from class org.deegree.commons.index.SpatialIndex
createEnvelope, intersects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outputWarning

boolean outputWarning
Constructor Detail

RTree

public RTree(Envelope rootEnvelope,
             int numberOfObjects)
Parameters:
rootEnvelope - of this rtree.
numberOfObjects - each rectangle shall hold before splitting.

RTree

public RTree(InputStream is)
      throws IOException,
             ClassNotFoundException
Rereads this RTree from a serialized file to which is should point.

Parameters:
is -
Throws:
IOException
ClassNotFoundException
Method Detail

query

public LinkedList<T> query(Envelope env)
Description copied from class: SpatialIndex
Query the spatial index with the given envelope and return all objects which intersect with the given boundingbox.

Specified by:
query in class SpatialIndex<T>
Parameters:
env -
Returns:
a list of objects intersecting the given boundingbox.

insertBulk

public void insertBulk(List<Pair<Envelope,T>> listOfObjects)
Builds the index from the given objects with their envelope.

Specified by:
insertBulk in class SpatialIndex<T>
Parameters:
listOfObjects -

write

public void write(RandomAccessFile output,
                  boolean extraFlag)
           throws IOException
Parameters:
output -
extraFlag -
Throws:
IOException

clear

public void clear()
Description copied from class: SpatialIndex
Removes all objects from this spatial index.

Specified by:
clear in class SpatialIndex<T>

remove

public boolean remove(T object)
Description copied from class: SpatialIndex
Removes the given object from this spatial index, using the objects' equals method.

Specified by:
remove in class SpatialIndex<T>
Parameters:
object - to be removed
Returns:
true if the removal was successful, false otherwise

insert

public boolean insert(Envelope envelope,
                      T object)
Description copied from class: SpatialIndex
Add the given object to the spatial index using the given boundingbox

Specified by:
insert in class SpatialIndex<T>
Parameters:
envelope - of the object
object - to insert
Returns:
true if the object could be inserted.

getExtraFlag

public boolean getExtraFlag()
Returns:
extra flag read from a file (used for hacking around buggy shp files)

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

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

]]>