src/geoDogUtils.js
function(coordinate,size) {
  var latDeltaDegrees = size/g_METERS_PER_DEGREE_LATITUDE;
  var latitudeNorth = Math.min(90, coordinate[0] + latDeltaDegrees);
  var latitudeSouth = Math.max(-90, coordinate[0] - latDeltaDegrees);
  var bitsLat = Math.floor(latitudeBitsForResolution(size))*2;
  var bitsLongNorth = Math.floor(longitudeBitsForResolution(size, latitudeNorth))*2-1;
  var bitsLongSouth = Math.floor(longitudeBitsForResolution(size, latitudeSouth))*2-1;
  return Math.min(bitsLat, bitsLongNorth, bitsLongSouth, g_MAXIMUM_BITS_PRECISION);
}
function(coordinate,size) {
  var latDeltaDegrees = size/g_METERS_PER_DEGREE_LATITUDE;
  var latitudeNorth = Math.min(90, coordinate[0] + latDeltaDegrees);
  var latitudeSouth = Math.max(-90, coordinate[0] - latDeltaDegrees);
  var bitsLat = Math.floor(latitudeBitsForResolution(size))*2;
  var bitsLongNorth = Math.floor(longitudeBitsForResolution(size, latitudeNorth))*2-1;
  var bitsLongSouth = Math.floor(longitudeBitsForResolution(size, latitudeSouth))*2-1;
  return Math.min(bitsLat, bitsLongNorth, bitsLongSouth, g_MAXIMUM_BITS_PRECISION);
}
function ( coordinate , size ) { var latDeltaDegrees = size / g_METERS_PER_DEGREE_LATITUDE ; var latitudeNorth = Math . min ( 90 , coordinate [ 0 ] + latDeltaDegrees ) ; var latitudeSouth = Math . max ( - 90 , coordinate [ 0 ] - latDeltaDegrees ) ; var bitsLat = Math . floor ( latitudeBitsForResolution ( size ) ) * 2 ; var bitsLongNorth = Math . floor ( longitudeBitsForResolution ( size , latitudeNorth ) ) * 2 - 1 ; var bitsLongSouth = Math . floor ( longitudeBitsForResolution ( size , latitudeSouth ) ) * 2 - 1 ; return Math . min ( bitsLat , bitsLongNorth , bitsLongSouth , g_MAXIMUM_BITS_PRECISION ) ; }
Calculates the maximum number of bits of a geohash to get a bounding box that is larger than a
given size at the given coordinate.

@param {Array.<number>} coordinate The coordinate as a [latitude, longitude] pair.
@param {number} size The size of the bounding box.
@return {number} The number of bits necessary for the geohash.
Calculates the maximum number of bits of a geohash to get a bounding box that is larger than a given size at the given coordinate .