示例#1
0
 private static void divideRangeDecode(GeoHash geoHash, double[] range, boolean isOnBit) {
   double mid = (range[0] + range[1]) / 2;
   if (isOnBit) {
     geoHash.addOnBitToEnd();
     range[0] = mid;
   } else {
     geoHash.addOffBitToEnd();
     range[1] = mid;
   }
 }
示例#2
0
 private static void divideRangeEncode(GeoHash geoHash, double value, double[] range) {
   double mid = (range[0] + range[1]) / 2;
   if (value >= mid) {
     geoHash.addOnBitToEnd();
     range[0] = mid;
   } else {
     geoHash.addOffBitToEnd();
     range[1] = mid;
   }
 }