 geo_point field does not support GeoJson which can be a PITA if your data is in such a format. Indexing it as a geo_shape is an option but very wasteful.
server/src/main/java/org/elasticsearch/common/geo/GeoUtils.java
public static final double EARTH_POLAR_DISTANCE = Math.PI * EARTH_SEMI_MINOR_AXIS;
    
    public static final double TOLERANCE = 1E-6;
    private static final int QUAD_MAX_LEVELS_POSSIBLE = 50;
    private static final int GEOHASH_MAX_LEVELS_POSSIBLE = 24;
    
    public static boolean isValidLatitude(double latitude) {
        if (Double.isNaN(latitude) || Double.isInfinite(latitude) || latitude < GeoUtils.MIN_LAT || latitude > GeoUtils.MAX_LAT) {
            return false;
        }
        return true;
    }
    
    public static boolean isValidLongitude(double longitude) {
        if (Double.isNaN(longitude) || Double.isInfinite(longitude) || longitude < GeoUtils.MIN_LON || longitude > GeoUtils.MAX_LON) {
            return false;
        }
        return true;
    }
    /**
     * Calculate the width (in meters) of geohash cells at a specific level
     * @param level geohash level must be greater or equal to zero
     * @return the width of cells at level in meters
     */
    public static double geoHashCellWidth(int level) {
        assert level >= 0;
        
        
        return EARTH_EQUATOR / (1L << ((((level + 1) / 2) * 3) + ((level / 2) * 2)));