Geobox { protected static long getHashIterative(float major, float minor, final int bits) { long hash = 0; float temp; for (int b = bits, i = 0; 0 <= b; b--, i++) { temp = minor; if (major < 0f) { minor = major + D_MAJOR[i+1]; } else { hash |= 1L << b; minor = major - D_MAJOR[i+1]; } major = temp; } return hash; }  static long getMask(float x, float base, int bits); static long getHash(float lat, float lng, int bits); static Set<Long> getTuple(float lat, float lng, int bits); static double distance(DLocation p1, DLocation p2); static double makeDoubleInRange(double d); static int getCellSize(int bits); static double getCellSize(int bits, double latitude); static double distance(double p1lat, double p1lon, double p2lat, double p2lon); static final int RADIUS; static final int D; @Deprecated
    static final int BITS_10_39km; @Deprecated
    static final int BITS_12_10km; @Deprecated
    static final int BITS_15_1224m; @Deprecated
    static final int BITS_17_307m; @Deprecated
    static final int BITS_18_154m; @Deprecated
    static final int BITS_19_77m; @Deprecated
    static final int BITS_20_39m; @Deprecated
    static final int BITS_22_10m; @Deprecated
    static final int BITS_23_53dm; @Deprecated
    static final int BITS_24_32dm; static final int BITS_0_40075004m; static final int BITS_1_20037502m; static final int BITS_2_10018751m; static final int BITS_3_5009375m; static final int BITS_4_2504687m; static final int BITS_5_1252343m; static final int BITS_6_626171m; static final int BITS_7_313085m; static final int BITS_8_156542m; static final int BITS_9_78271m; static final int BITS_10_39135m; static final int BITS_11_19567m; static final int BITS_12_9783m; static final int BITS_13_4891m; static final int BITS_14_2445m; static final int BITS_15_1222m; static final int BITS_16_611m; static final int BITS_17_305m; static final int BITS_18_152m; static final int BITS_19_76m; static final int BITS_20_38m; static final int BITS_21_19m; static final int BITS_22_9m; static final int BITS_23_4m; static final int BITS_24_2m; static final int BITS_25_1m; static final int BITS_26_0m; }
@Test public void testGetHashNE() { assertEquals("NE, 2 bit", 3L, Geobox.getHashIterative(120f, 45f, 1)); }
@Test public void testGetHashOrigo() { assertEquals("(0,0), 16 bit", 0xC000L, Geobox.getHashIterative(0f, 0f, 15)); }
@Test public void testGetHashNEedge() { assertEquals("(90,180), 16 bit", 0xFFFFL, Geobox.getHashIterative(180f, 90f, 15)); }
@Test public void testGetHashSWedge() { assertEquals("(-90,-180), 16 bit", 0x0000L, Geobox.getHashIterative(-180f, -90f, 15)); }
@Test public void testGetHashN() { assertEquals("E, 1 bit", 1L, Geobox.getHashIterative(120f, -45f, 0)); }