@Reference(authors="G. R. Hjaltason, H. Samet", title="Ranking in spatial databases", booktitle="Advances in Spatial Databases - 4th Symposium, SSD\'95", url="http://dx.doi.org/10.1007/3-540-60159-7_6") public class DoubleDistanceRStarTreeKNNQuery<O extends SpatialComparable> extends AbstractDistanceKNNQuery<O,DoubleDistance>
G. R. Hjaltason, H. Samet
Ranking in spatial databases
In: 4th Symposium on Advances in Spatial Databases, SSD'95
Modifier and Type | Class and Description |
---|---|
(package private) class |
DoubleDistanceRStarTreeKNNQuery.DoubleDistanceEntry
Optimized double distance entry implementation.
|
Modifier and Type | Field and Description |
---|---|
protected SpatialPrimitiveDoubleDistanceFunction<? super O> |
distanceFunction
Spatial primitive distance function
|
protected AbstractRStarTree<?,?,?> |
tree
The index to use
|
distanceQuery
relation
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
Constructor and Description |
---|
DoubleDistanceRStarTreeKNNQuery(AbstractRStarTree<?,?,?> tree,
DistanceQuery<O,DoubleDistance> distanceQuery,
SpatialPrimitiveDoubleDistanceFunction<? super O> distanceFunction)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
batchNN(AbstractRStarTreeNode<?,?> node,
Map<DBID,DoubleDistanceKNNHeap> knnLists)
Performs a batch knn query.
|
private double |
expandNode(O object,
DoubleDistanceKNNHeap knnList,
ComparableMinHeap<DoubleDistanceSearchCandidate> pq,
double maxDist,
int nodeID) |
List<DoubleDistanceKNNList> |
getKNNForBulkDBIDs(ArrayDBIDs ids,
int k)
Bulk query method
|
DoubleDistanceKNNList |
getKNNForObject(O obj,
int k)
Get the k nearest neighbors for a particular id.
|
protected List<DoubleDistanceRStarTreeKNNQuery.DoubleDistanceEntry> |
getSortedEntries(AbstractRStarTreeNode<?,?> node,
DBIDs ids)
Sorts the entries of the specified node according to their minimum distance
to the specified objects.
|
getKNNForDBID
getRelation
protected final AbstractRStarTree<?,?,?> tree
protected final SpatialPrimitiveDoubleDistanceFunction<? super O extends SpatialComparable> distanceFunction
public DoubleDistanceRStarTreeKNNQuery(AbstractRStarTree<?,?,?> tree, DistanceQuery<O,DoubleDistance> distanceQuery, SpatialPrimitiveDoubleDistanceFunction<? super O> distanceFunction)
tree
- Index to usedistanceQuery
- Distance query to usedistanceFunction
- Distance functionpublic DoubleDistanceKNNList getKNNForObject(O obj, int k)
KNNQuery
getKNNForObject
in interface KNNQuery<O extends SpatialComparable,DoubleDistance>
getKNNForObject
in class AbstractDistanceKNNQuery<O extends SpatialComparable,DoubleDistance>
obj
- Query objectk
- Number of neighbors requestedprivate double expandNode(O object, DoubleDistanceKNNHeap knnList, ComparableMinHeap<DoubleDistanceSearchCandidate> pq, double maxDist, int nodeID)
protected void batchNN(AbstractRStarTreeNode<?,?> node, Map<DBID,DoubleDistanceKNNHeap> knnLists)
node
- the node for which the query should be performedknnLists
- a map containing the knn lists for each query objectsprotected List<DoubleDistanceRStarTreeKNNQuery.DoubleDistanceEntry> getSortedEntries(AbstractRStarTreeNode<?,?> node, DBIDs ids)
node
- the nodeids
- the id of the objectspublic List<DoubleDistanceKNNList> getKNNForBulkDBIDs(ArrayDBIDs ids, int k)
KNNQuery
getKNNForBulkDBIDs
in interface KNNQuery<O extends SpatialComparable,DoubleDistance>
getKNNForBulkDBIDs
in class AbstractDistanceKNNQuery<O extends SpatialComparable,DoubleDistance>
ids
- query object IDsk
- Number of neighbors requested