Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products. If you have feedback or questions as you navigate the site, click Send Feedback.

GeoPt (Google App Engine API for Java)

Stay organized with collections Save and categorize content based on your preferences.

Class GeoPt

  • java.lang.Object
  • All Implemented Interfaces:, java.lang.Comparable<GeoPt>

    public final class GeoPt
    extends java.lang.Object
    implements, java.lang.Comparable<GeoPt>
    A geographical point, specified by float latitude and longitude coordinates. Often used to integrate with mapping sites like Google Maps.
    See Also:
    Serialized Form
    • Constructor Detail

      • GeoPt

        public GeoPt(float latitude,
                     float longitude)
        Constructs a GeoPt.
        latitude - The latitude. Must be between -90 and 90 (inclusive).
        longitude - The longitude. Must be between -180 and 180 (inclusive).
        java.lang.IllegalArgumentException - If latitude or longitude is outside the legal range.
    • Method Detail

      • getLatitude

        public float getLatitude()
      • getLongitude

        public float getLongitude()
      • compareTo

        public int compareTo(GeoPt o)
        Sort first by latitude, then by longitude
        Specified by:
        compareTo in interface java.lang.Comparable<GeoPt>
      • equals

        public boolean equals(java.lang.Object o)
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object