Class GeoDistance

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class GeoDistance
    extends UnaryFieldExpression
    Computes the geographical distance from a center point.
    See Also:
    Serialized Form
    • Field Detail

      • DEFAULT_DISTANCE_UNITS

        public static final DistanceUnits DEFAULT_DISTANCE_UNITS
    • Constructor Detail

      • GeoDistance

        public GeoDistance​(java.lang.String fieldName,
                           Point center,
                           DistanceUnits units)
      • GeoDistance

        public GeoDistance​(java.lang.String fieldName,
                           double latitude,
                           double longitude)
        Calculate the geo distance.
      • GeoDistance

        public GeoDistance​(FieldExpression expression,
                           double latitude,
                           double longitude)
        Construct a new FieldFunction to apply an aggregation function to another expression.
      • GeoDistance

        public GeoDistance​(FieldExpression expression,
                           double latitude,
                           double longitude,
                           DistanceUnits distanceUnits)
        Construct a new FieldFunction to apply an aggregation function to another expression.
    • Method Detail

      • getDistanceUnits

        public DistanceUnits getDistanceUnits()
        Get the units the distance will be returned in (meters, kilometers, etc)
      • setDistanceUnits

        public void setDistanceUnits​(DistanceUnits units)
        Get the units the distance will be returned in (meters, kilometers, etc)
      • getLatitude

        public double getLatitude()
        Get the center latitude to calculate distance to.
      • setLatitude

        public void setLatitude​(double latitude)
        Set the center latitude to calculate distance to.
      • getLongitude

        public double getLongitude()
        Get the center longitude to calculate distance to.
      • setLongitude

        public void setLongitude​(double longitude)
        Set the center longitude to calculate distance to.