Send feedback
Class GeoPt (2.0.0)
Stay organized with collections
Save and categorize content based on your preferences.
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.
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 )
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
Overrides
getLatitude()
public float getLatitude ()
Returns
Type
Description
float
getLongitude()
public float getLongitude ()
Returns
Type
Description
float
hashCode()
Returns
Type
Description
int
Overrides
toString()
Returns
Type
Description
String
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-19 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-19 UTC."],[],[]]