Class GeoPt (2.0.0)

public final class GeoPt implements Serializable, Comparable<GeoPt>

A geographical point, specified by float latitude and longitude coordinates. Often used to integrate with mapping sites like Google Maps.

Inheritance

java.lang.Object > GeoPt

Static Fields

EARTH_RADIUS_METERS

public static final double EARTH_RADIUS_METERS
Field Value
TypeDescription
double

serialVersionUID

public static final long serialVersionUID
Field Value
TypeDescription
long

Constructors

GeoPt(float latitude, float longitude)

public GeoPt(float latitude, float longitude)

Constructs a GeoPt.

Parameters
NameDescription
latitudefloat

The latitude. Must be between -90 and 90 (inclusive).

longitudefloat

The longitude. Must be between -180 and 180 (inclusive).

Methods

compareTo(GeoPt o)

public int compareTo(GeoPt o)

Sort first by latitude, then by longitude

Parameter
NameDescription
oGeoPt
Returns
TypeDescription
int

equals(@Nullable Object o)

public boolean equals(@Nullable Object o)
Parameter
NameDescription
o@org.checkerframework.checker.nullness.qual.Nullable java.lang.Object
Returns
TypeDescription
boolean
Overrides

getLatitude()

public float getLatitude()
Returns
TypeDescription
float

getLongitude()

public float getLongitude()
Returns
TypeDescription
float

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

toString()

public String toString()
Returns
TypeDescription
String
Overrides