Class GeoPt (5.0.3)
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)
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
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 2026-06-03 UTC.
[null,null,["Last updated 2026-06-03 UTC."],[],[]]