GeoPoint

public classGeoPoint implementsComparable


Immutable class representing aGeoPoint in Cloud Firestore

Summary

Public fields

final double
final double

Public constructors

GeoPoint(double latitude, double longitude)

Construct a newGeoPoint using the provided latitude and longitude values.

Public methods

int
boolean
double
double
int
@NonNullString

Public fields

latitude

public final double latitude

longitude

public final double longitude

Public constructors

GeoPoint

public GeoPoint(double latitude, double longitude)

Construct a newGeoPoint using the provided latitude and longitude values.

Parameters
double latitude

The latitude of thisGeoPoint in the range [-90, 90].

double longitude

The longitude of thisGeoPoint in the range [-180, 180].

Public methods

compareTo

public int compareTo(@NonNullGeoPoint other)

equals

public boolean equals(@NullableObject o)

getLatitude

public double getLatitude()
Returns
double

The latitude value of thisGeoPoint.

getLongitude

public double getLongitude()
Returns
double

The longitude value of thisGeoPoint.

hashCode

public int hashCode()

toString

public @NonNullString toString()

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.