org.apache.ignite.ml.knn.utils.indices

## Interface SpatialIndex<L>

- Type Parameters:
    `L` - Label type.
  All Superinterfaces:
    AutoCloseable
  All Known Implementing Classes:
    ArraySpatialIndex, BallTreeSpatialIndex, KDTreeSpatialIndex, KNNClassificationModel, KNNModel, KNNRegressionModel

      public interface SpatialIndex<L>
      extends AutoCloseable

  An index that works with spatial data and allows to quickly find `k` closest element.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default void` | `close()`
    `List<LabeledVector<L>>` | `findKClosest(int k, Vector pnt)` Finds `k` closest elements to the specified point.

- - ### Method Detail

    - #### findKClosest

          List<LabeledVector<L>> findKClosest(int k,
                                              Vector pnt)

      Finds `k` closest elements to the specified point.
      Parameters:
        `k` - Number of elements to be returned.
        `pnt` - Point to be used to calculate distance to other points.
      Returns:
        An array of the `k` closest elements to the specified point.

    - #### close

          default void close()

      Specified by:
        `close` in interface `AutoCloseable`

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021