 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
} catch (IllegalArgumentException e2) {
                    
                    throw new IllegalArgumentException("precision too high [" + precision + "]", e2);
                }
            }
        }
    }
    /**
     * Checks that the precision is within range supported by elasticsearch - between 1 and 12
     *
     * Returns the precision value if it is in the range and throws an IllegalArgumentException if it
     * is outside the range.
     */
    public static int checkPrecisionRange(int precision) {
        if ((precision < 1) || (precision > 12)) {
            throw new IllegalArgumentException("Invalid geohash aggregation precision of " + precision + ". Must be between 1 and 12.");
        }
        return precision;
    }
    
    public static double maxRadialDistanceMeters(final double centerLat, final double centerLon) {
        if (Math.abs(centerLat) == MAX_LAT) {
            return SloppyMath.haversinMeters(centerLat, centerLon, 0, centerLon);
        }
        return SloppyMath.haversinMeters(centerLat, centerLon, centerLat, (MAX_LON + centerLon) % 360);
    }
    
    public static double arcDistance(double lat1, double lon1, double lat2, double lon2) {
        return SloppyMath.haversinMeters(lat1, lon1, lat2, lon2);
    }