org.gcube.indexmanagement.geo
Class RTreeWrapper

java.lang.Object
  extended by org.geotools.index.rtree.RTree
      extended by org.gcube.indexmanagement.geo.RTreeWrapper
All Implemented Interfaces:
Comparable<RTreeWrapper>

public class RTreeWrapper
extends org.geotools.index.rtree.RTree
implements Comparable<RTreeWrapper>

A class extending the RTree with data and functionality useful when building a pyramid of indices.


Nested Class Summary
static class RTreeWrapper.GeoSearchModifiers
           
static class RTreeWrapper.SupportedRelations
           
 
Constructor Summary
RTreeWrapper(File indexFile, GeoIndexType indexTypeObject, long maxArea, RandomAccessFile rawData)
          A constructor which builds an index that stores data in the specified PageStore, and which handles envelopes with an area size lower than the specified maxArea.
RTreeWrapper(File indexFile, GeoIndexType indexTypeObject, RandomAccessFile rawData)
          A constructor which builds an index that stores data in the specified PageStore
 
Method Summary
 int compareTo(RTreeWrapper object)
           
 String getIndexFile()
           
 long getMaxArea()
          Gets the maximum area of objects to be handled by this index
 void insert(DataWrapper geoData)
          Inserts an Entry into the wrapped RTree
 QueryResults performQuery(com.vividsolutions.jts.geom.Envelope query, InclusionType method, Refiner[] refiners, RankEvaluator ranker)
          Performs a query on this index
 void setMaxArea(long area)
          Sets the maximum area of objects to be handled by this index
 
Methods inherited from class org.geotools.index.rtree.RTree
close, delete, getBounds, getBounds, getDataDefinition, insert, search, search, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RTreeWrapper

public RTreeWrapper(File indexFile,
                    GeoIndexType indexTypeObject,
                    RandomAccessFile rawData)
             throws org.geotools.index.TreeException
A constructor which builds an index that stores data in the specified PageStore

Parameters:
indexFile - - the file where to store data.
indexTypeObject - - the geo type object.
Throws:
org.geotools.index.TreeException - - in case opf failure.

RTreeWrapper

public RTreeWrapper(File indexFile,
                    GeoIndexType indexTypeObject,
                    long maxArea,
                    RandomAccessFile rawData)
             throws org.geotools.index.TreeException
A constructor which builds an index that stores data in the specified PageStore, and which handles envelopes with an area size lower than the specified maxArea.

Parameters:
indexFile - - the file where to store data.
indexTypeObject - - the geo object type.
maxArea - long - the maximum area of objects to be handled by this index
Throws:
org.geotools.index.TreeException - - in case of failure
Method Detail

insert

public void insert(DataWrapper geoData)
            throws IndexException
Inserts an Entry into the wrapped RTree

Parameters:
geoData - - A DataWrapper containing the coordinates, id and data of the entry to be added
Throws:
IndexException - unable to insert the entry into the RTree

setMaxArea

public void setMaxArea(long area)
Sets the maximum area of objects to be handled by this index

Parameters:
maxArea - long - the maximum area of objects to be handled by this index

getMaxArea

public long getMaxArea()
Gets the maximum area of objects to be handled by this index

Returns:
long - the maximum area of objects to be handled by this index

compareTo

public int compareTo(RTreeWrapper object)
Specified by:
compareTo in interface Comparable<RTreeWrapper>

getIndexFile

public String getIndexFile()

performQuery

public QueryResults performQuery(com.vividsolutions.jts.geom.Envelope query,
                                 InclusionType method,
                                 Refiner[] refiners,
                                 RankEvaluator ranker)
                          throws org.geotools.index.TreeException,
                                 org.geotools.index.LockTimeoutException,
                                 Exception
Performs a query on this index

Parameters:
query - - The area to look for results in
method - - The containment method to use for the query
refiners - - A list refiners to use to refine the results
ranker - - A ranker to use to rank/sort the results
Returns:
- an object containing the results of the query.
Throws:
org.geotools.index.TreeException - - an error querying the underlying RTree
org.geotools.index.LockTimeoutException - - an error querying the underlying RTree
Exception


Copyright © 2012. All Rights Reserved.