org.elasticsearch.index.search.geo
Class LatLng

java.lang.Object
  extended by org.elasticsearch.index.search.geo.LatLng

public class LatLng
extends java.lang.Object


Constructor Summary
LatLng(double lat, double lng)
           
 
Method Summary
 double arcDistance(LatLng ll2)
          Calculates the distance between two lat/lng's in miles.
 double arcDistance(LatLng ll2, DistanceUnit lUnits)
          Calculates the distance between two lat/lng's in miles or meters.
 boolean equals(LatLng other)
           
 boolean equals(java.lang.Object other)
           
 double getLat()
           
 double getLng()
           
 boolean isNormalized()
           
 LatLng normalize()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LatLng

public LatLng(double lat,
              double lng)
Method Detail

isNormalized

public boolean isNormalized()

normalize

public LatLng normalize()

getLat

public double getLat()

getLng

public double getLng()

equals

public boolean equals(LatLng other)

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

arcDistance

public double arcDistance(LatLng ll2)
Calculates the distance between two lat/lng's in miles. Imported from mq java client.

Parameters:
ll2 - Second lat,lng position to calculate distance to.
Returns:
Returns the distance in miles.

arcDistance

public double arcDistance(LatLng ll2,
                          DistanceUnit lUnits)
Calculates the distance between two lat/lng's in miles or meters. Imported from mq java client. Variable references changed to match.

Parameters:
ll2 - Second lat,lng position to calculate distance to.
lUnits - Units to calculate distace, defaults to miles
Returns:
Returns the distance in meters or miles.