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
Type Description
double

serialVersionUID

public static final long serialVersionUID
Field Value
Type Description
long

Constructors

GeoPt(float latitude, float longitude)

public GeoPt(float latitude, float longitude)

Constructs a GeoPt.

Parameters
Name Description
latitude float

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

longitude float

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
Name Description
o GeoPt
Returns
Type Description
int

equals(@Nullable Object o)

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

getLatitude()

public float getLatitude()
Returns
Type Description
float

getLongitude()

public float getLongitude()
Returns
Type Description
float

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

toString()

public String toString()
Returns
Type Description
String
Overrides