Class NearestNeighbor


  • class NearestNeighbor
    extends java.lang.Object
    KNN search on top of 2D lat/lon indexed points.
    • Constructor Detail

      • NearestNeighbor

        NearestNeighbor()
    • Method Detail

      • nearest

        public static NearestNeighbor.NearestHit[] nearest​(double pointLat,
                                                           double pointLon,
                                                           java.util.List<BKDReader> readers,
                                                           java.util.List<Bits> liveDocs,
                                                           java.util.List<java.lang.Integer> docBases,
                                                           int n)
                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • approxBestDistance

        private static double approxBestDistance​(byte[] minPackedValue,
                                                 byte[] maxPackedValue,
                                                 double pointLat,
                                                 double pointLon)
      • approxBestDistance

        private static double approxBestDistance​(double minLat,
                                                 double maxLat,
                                                 double minLon,
                                                 double maxLon,
                                                 double pointLat,
                                                 double pointLon)