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
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-05-17 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]