Java 8 has reached end of support
and will be
deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Java 8
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Java
8 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you
migrate to the latest supported version of Java.
GeoPt (Google App Engine API for Java)
Stay organized with collections
Save and categorize content based on your preferences.
- java.lang.Object
-
- com.google.appengine.api.datastore.GeoPt
-
-
Constructor Summary
Constructors
Constructor and Description |
GeoPt(float latitude,
float longitude)
Constructs a GeoPt .
|
-
Method Summary
-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
-
-
Constructor Detail
-
GeoPt
public GeoPt(float latitude,
float longitude)
Constructs a GeoPt
.
- Parameters:
latitude
- The latitude. Must be between -90 and 90 (inclusive).
longitude
- The longitude. Must be between -180 and 180 (inclusive).
- Throws:
java.lang.IllegalArgumentException
- If latitude
or longitude
is outside the legal
range.
-
Method Detail
-
getLatitude
public float getLatitude()
-
getLongitude
public float getLongitude()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
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 2025-06-16 UTC.
[[["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 2025-06-16 UTC."],[[["\u003cp\u003e\u003ccode\u003eGeoPt\u003c/code\u003e is a class representing a geographical point using latitude and longitude coordinates, often used for integration with mapping services.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGeoPt\u003c/code\u003e class implements \u003ccode\u003eSerializable\u003c/code\u003e and \u003ccode\u003eComparable<GeoPt>\u003c/code\u003e, meaning it can be serialized and compared to other \u003ccode\u003eGeoPt\u003c/code\u003e objects, respectively.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a \u003ccode\u003eGeoPt\u003c/code\u003e object by providing the latitude (between -90 and 90) and longitude (between -180 and 180) as float values.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGeoPt\u003c/code\u003e includes methods to get the latitude and longitude, compare itself to another \u003ccode\u003eGeoPt\u003c/code\u003e, check for equality, get a hash code, and represent itself as a string.\u003c/p\u003e\n"],["\u003cp\u003eThe class also includes constant fields for the \u003ccode\u003eserialVersionUID\u003c/code\u003e and \u003ccode\u003eEARTH_RADIUS_METERS\u003c/code\u003e, which are used for serialization and potentially in calculations, respectively.\u003c/p\u003e\n"]]],[],null,["# GeoPt (Google App Engine API for Java)\n\ncom.google.appengine.api.datastore\n\nClass GeoPt\n-----------\n\n- java.lang.Object\n-\n - com.google.appengine.api.datastore.GeoPt\n\n-\n\n All Implemented Interfaces:\n : java.io.Serializable, java.lang.Comparable\\\u003c[GeoPt](../../../../../com/google/appengine/api/datastore/GeoPt.html \"class in com.google.appengine.api.datastore\")\\\u003e\n\n *** ** * ** ***\n\n \u003cbr /\u003e\n\n ```\n public final class GeoPt\n extends java.lang.Object\n implements java.io.Serializable, java.lang.Comparable\u003cGeoPt\u003e\n ``` \n A geographical point, specified by float latitude and longitude coordinates. Often used to integrate with mapping sites like Google Maps.\n\n See Also:\n: [Serialized Form](../../../../../serialized-form.html#com.google.appengine.api.datastore.GeoPt) \n-\n -\n\n ### Field Summary\n\n \u003c!-- --\u003e\n\n -\n\n ### Constructor Summary\n\n \u003c!-- --\u003e\n\n -\n\n ### Method Summary\n\n -\n\n ### Methods inherited from class java.lang.Object\n\n`getClass, notify, notifyAll, wait, wait, wait` \n-\n -\n\n ### Field Detail\n\n\n -\n\n #### serialVersionUID\n\n ```\n public static final long serialVersionUID\n ```\n\n See Also:\n : [Constant Field Values](../../../../../constant-values.html#com.google.appengine.api.datastore.GeoPt.serialVersionUID)\n\n\n -\n\n #### EARTH_RADIUS_METERS\n\n ```\n public static final double EARTH_RADIUS_METERS\n ```\n\n See Also:\n : [Constant Field Values](../../../../../constant-values.html#com.google.appengine.api.datastore.GeoPt.EARTH_RADIUS_METERS)\n\n \u003c!-- --\u003e\n\n -\n\n ### Constructor Detail\n\n\n -\n\n #### GeoPt\n\n ```\n public GeoPt(float latitude,\n float longitude)\n ``` \n Constructs a `GeoPt`.\n\n Parameters:\n : `latitude` - The latitude. Must be between -90 and 90 (inclusive).\n : `longitude` - The longitude. Must be between -180 and 180 (inclusive).\n\n Throws:\n : `java.lang.IllegalArgumentException` - If `latitude` or `longitude` is outside the legal\n range.\n\n \u003c!-- --\u003e\n\n -\n\n ### Method Detail\n\n\n -\n\n #### getLatitude\n\n ```\n public float getLatitude()\n ```\n\n\n -\n\n #### getLongitude\n\n ```\n public float getLongitude()\n ```\n\n\n -\n\n #### compareTo\n\n ```\n public int compareTo(GeoPt o)\n ``` \n Sort first by latitude, then by longitude\n\n Specified by:\n : `compareTo` in interface `java.lang.Comparable\u003c`[GeoPt](../../../../../com/google/appengine/api/datastore/GeoPt.html \"class in com.google.appengine.api.datastore\")`\u003e`\n\n\n -\n\n #### equals\n\n ```\n public boolean equals(java.lang.Object o)\n ```\n\n Overrides:\n : `equals` in class `java.lang.Object`\n\n\n -\n\n #### hashCode\n\n ```\n public int hashCode()\n ```\n\n Overrides:\n : `hashCode` in class `java.lang.Object`\n\n\n -\n\n #### toString\n\n ```\n public java.lang.String toString()\n ```\n\n Overrides:\n : `toString` in class `java.lang.Object`"]]