Class SpatialQueryArray<E>

java.lang.Object
org.stianloader.stianknn.SpatialQueryArray<E>
Type Parameters:
E -
All Implemented Interfaces:
SpatialIndex1NN<E>, SpatialIndexKNN<E>

public class SpatialQueryArray<@NotNull E> extends Object implements SpatialIndexKNN<E>
Code heavily based on a gist made by someone else.
  • Constructor Details

    • SpatialQueryArray

      public SpatialQueryArray(Collection<PointObjectPair<@NotNull E>> points, float minX, float minY, float maxX, float maxY, float cellWidth, float cellHeight)
  • Method Details

    • query1nn

      @Nullable public E query1nn(float x, float y)
      Specified by:
      query1nn in interface SpatialIndex1NN<E>
    • queryKnn

      public void queryKnn(float x, float y, int nearestNeighbours, @NotNull @NotNull Consumer<@NotNull E> out)
      Specified by:
      queryKnn in interface SpatialIndexKNN<E>