def _decode(geohash, max_coord):
    """Returns a tuple with the coord and the range of the boundary
    defined by the binary geohash."""
    coord = 0
    for c in geohash:
        max_coord /= 2
        coord = coord - max_coord if c == '0' else coord + max_coord
    return coord, max_coord * 2
