Interface RectangleIndex<T>

    • Method Detail

      • insert

        void insert​(double[] lower,
                    double[] upper,
                    T value)
        Insert a rectangle.
        Parameters:
        lower - minimum corner
        upper - maximum corner
        value - value
      • remove

        T remove​(double[] lower,
                 double[] upper)
        Remove an entry.
        Parameters:
        lower - minimum corner
        upper - maximum corner
        Returns:
        the value of the entry or null if the entry was not found
      • update

        T update​(double[] lo1,
                 double[] up1,
                 double[] lo2,
                 double[] up2)
        Update the position of an entry.
        Parameters:
        lo1 - old min
        up1 - old max
        lo2 - new min
        up2 - new max
        Returns:
        the value, or null if the entries was not found
      • queryExact

        T queryExact​(double[] lower,
                     double[] upper)
        Lookup an entry, using exact match.
        Parameters:
        lower - minimum corner
        upper - maximum corner
        Returns:
        the value of the entry or null if the entry was not found
      • queryIntersect

        QueryIterator<RectangleEntry<T>> queryIntersect​(double[] min,
                                                        double[] max)
        Parameters:
        min - Lower left corner of the query window
        max - Upper right corner of the query window
        Returns:
        All rectangles that intersect with the query rectangle.
      • query1NN

        default RectangleEntryDist<T> query1NN​(double[] center)
        Finds the nearest neighbor. This uses euclidean 'edge distance'. Other distance types can only be specified directly on the index implementations.
        Parameters:
        center - center point
        Returns:
        the nearest neighbor
      • queryKNN

        QueryIteratorKNN<RectangleEntryDist<T>> queryKNN​(double[] center,
                                                         int k)
        Finds the nearest neighbor. This uses euclidean 'edge distance', i.e. the distance to the edge of rectangle. Distance is 0 is the rectangle overlaps with the search point. Other distance types can only be specified directly on the index implementations.
        Parameters:
        center - center point
        k - number of neighbors
        Returns:
        list of nearest neighbors