@Reference(authors="G. R. Hjaltason, H. Samet", title="Ranking in spatial databases", booktitle="4th Symp. Advances in Spatial Databases (SSD\'95)", url="https://doi.org/10.1007/3-540-60159-7_6", bibkey="DBLP:conf/ssd/HjaltasonS95") public class RStarTreeKNNQuery<O extends SpatialComparable> extends java.lang.Object implements KNNQuery<O>
Reference:
G. R. Hjaltason, H. Samet
Ranking in spatial databases
4th Symp. Advances in Spatial Databases (SSD'95)
Modifier and Type | Class and Description |
---|---|
private static class |
RStarTreeKNNQuery.DoubleDistanceEntry
Optimized double distance entry implementation.
|
Modifier and Type | Field and Description |
---|---|
protected SpatialPrimitiveDistanceFunction<? super O> |
distanceFunction
Spatial primitive distance function.
|
protected Relation<? extends O> |
relation
Relation we query.
|
protected AbstractRStarTree<?,?,?> |
tree
The index to use
|
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
Constructor and Description |
---|
RStarTreeKNNQuery(AbstractRStarTree<?,?,?> tree,
Relation<? extends O> relation,
SpatialPrimitiveDistanceFunction<? super O> distanceFunction)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
batchNN(AbstractRStarTreeNode<?,?> node,
java.util.Map<DBID,KNNHeap> knnLists)
Performs a batch knn query.
|
private double |
expandNode(O object,
KNNHeap knnList,
DoubleIntegerMinHeap pq,
double maxDist,
int nodeID) |
java.util.List<KNNList> |
getKNNForBulkDBIDs(ArrayDBIDs ids,
int k)
Bulk query method
|
KNNList |
getKNNForDBID(DBIDRef id,
int k)
Get the k nearest neighbors for a particular id.
|
KNNList |
getKNNForObject(O obj,
int k)
Get the k nearest neighbors for a particular id.
|
protected java.util.List<RStarTreeKNNQuery.DoubleDistanceEntry> |
getSortedEntries(AbstractRStarTreeNode<?,?> node,
DBIDs ids)
Sorts the entries of the specified node according to their minimum distance
to the specified objects.
|
protected final AbstractRStarTree<?,?,?> tree
protected final SpatialPrimitiveDistanceFunction<? super O extends SpatialComparable> distanceFunction
protected Relation<? extends O extends SpatialComparable> relation
public RStarTreeKNNQuery(AbstractRStarTree<?,?,?> tree, Relation<? extends O> relation, SpatialPrimitiveDistanceFunction<? super O> distanceFunction)
tree
- Index to userelation
- Data relation to querydistanceFunction
- Distance functionpublic KNNList getKNNForDBID(DBIDRef id, int k)
KNNQuery
getKNNForDBID
in interface KNNQuery<O extends SpatialComparable>
id
- query object IDk
- Number of neighbors requestedpublic KNNList getKNNForObject(O obj, int k)
KNNQuery
getKNNForObject
in interface KNNQuery<O extends SpatialComparable>
obj
- Query objectk
- Number of neighbors requestedprivate double expandNode(O object, KNNHeap knnList, DoubleIntegerMinHeap pq, double maxDist, int nodeID)
protected void batchNN(AbstractRStarTreeNode<?,?> node, java.util.Map<DBID,KNNHeap> knnLists)
node
- the node for which the query should be performedknnLists
- a map containing the knn lists for each query objectsprotected java.util.List<RStarTreeKNNQuery.DoubleDistanceEntry> getSortedEntries(AbstractRStarTreeNode<?,?> node, DBIDs ids)
node
- the nodeids
- the id of the objectspublic java.util.List<KNNList> getKNNForBulkDBIDs(ArrayDBIDs ids, int k)
KNNQuery
getKNNForBulkDBIDs
in interface KNNQuery<O extends SpatialComparable>
ids
- query object IDsk
- Number of neighbors requestedCopyright © 2019 ELKI Development Team. License information.