Package org.stianloader.stianknn

# Interface SpatialIndexKNN<T>

Type Parameters:
  `T` - The type of the elements stored in the index.

All Superinterfaces:
  `SpatialIndex1NN<T>`

All Known Subinterfaces:
  `SpatialIndexIterable<E>`

All Known Implementing Classes:
  `SpatialBufferedQueryArray`, `SpatialQueryArray`, `SpatialQueryArrayLegacy`

public interface SpatialIndexKNN<T> extends SpatialIndex1NN<T>
A 2D spatial index that is capable of looking up the K nearest elements to a provided point. Note that fewer than K elements may get returned if fewer than K elements exist in the index.

Mutability is undefined for this interface, it is best to assume that it is unsupported. The behaviour of elements with equal distance (and thus overlapping points) are undefined by this interface.

This interface does not specify the behaviour when K is extremely large. Large values of K may result in overwhelming inefficiencies as well K elements are collected. This is especially critical if only a small fraction of the K elements are actually being read or otherwise used.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `queryKnn(float x, float y, int neighbourCount, @NotNull Consumer<@NotNull T> out)`

  ### Methods inherited from interface org.stianloader.stianknn.SpatialIndex1NN

  `query1nn`

- ## Method Details

  - ### queryKnn

    void queryKnn(float x, float y, int neighbourCount, @NotNull @NotNull Consumer<@NotNull T> out)