def _estimate_geohash_precision(r: int):
    """
    Returns hueristic geohash length for the given radius in meters.

    :param r: radius in meters
    """
    precision = 0
    if r > 1000000:
        precision = 1
    elif r > 250000:
        precision = 2
    elif r > 50000:
        precision = 3
    elif r > 10000:
        precision = 4
    elif r > 1000:
        precision = 5
    elif r > 250:
        precision = 6
    elif r > 50:
        precision = 7
    elif r > 1:
        precision = 8
    else:
        raise Exception(f"Not thinking about sub-meter resolution. radius={r}")

    return precision