Class KNNJoin

  • All Implemented Interfaces:
    Algorithm

    @Title("K-Nearest Neighbor Join")
    @Description("Algorithm to find the k-nearest neighbors of each object in a spatial database")
    @Priority(-10)
    public class KNNJoin
    extends java.lang.Object
    implements Algorithm
    Joins in a given spatial database to each object its k-nearest neighbors. This algorithm only supports spatial databases based on a spatial index structure.

    Since this method compares the MBR of every single leaf with every other leaf, it is essentially quadratic in the number of leaves, which may not be appropriate for large trees. It does currently not yet use the tree structure for pruning.

    TODO: exploit the tree structure.

    Since:
    0.1
    Author:
    Elke Achtert, Erich Schubert
    • Field Detail

      • LOG

        private static final Logging LOG
        The logger for this class.
      • k

        protected int k
        The k parameter.
    • Constructor Detail

      • KNNJoin

        public KNNJoin​(SpatialPrimitiveDistance<?> distance,
                       int k)
        Constructor.
        Parameters:
        distance - Distance function
        k - k parameter