firebase::firestore::GeoPoint

#include <geo_point.h>

An immutable object representing a geographical point inFirestore.

Summary

The point is represented as a latitude/longitude pair.

Latitude values are in the range of [-90, 90]. Longitude values are in the range of [-180, 180].

Constructors and Destructors

GeoPoint()
Creates aGeoPoint with both latitude and longitude set to 0.
GeoPoint(double latitude, double longitude)
Creates aGeoPoint from the provided latitude and longitude values.
GeoPoint(constGeoPoint & other)
Copy constructor,GeoPoint is trivially copyable.
GeoPoint(GeoPoint && other)
Move constructor, equivalent to copying.

Public functions

ToString() const
std::string
Returns a string representation of thisGeoPoint for logging/debugging purposes.
latitude() const
double
Returns the latitude value of thisGeoPoint.
longitude() const
double
Returns the latitude value of thisGeoPoint.
operator=(constGeoPoint & other)=default
Copy assignment operator,GeoPoint is trivially copyable.
operator=(GeoPoint && other)=default
Move assignment operator, equivalent to copying.

Friend classes

operator<<
friend std::ostream &
Outputs the string representation of thisGeoPoint to the given stream.

Public functions

GeoPoint

GeoPoint()=default

Creates aGeoPoint with both latitude and longitude set to 0.

GeoPoint

GeoPoint(doublelatitude,doublelongitude)

Creates aGeoPoint from the provided latitude and longitude values.

Details
Parameters
latitude
The latitude as number of degrees between -90 and 90.
longitude
The longitude as number of degrees between -180 and 180.

GeoPoint

GeoPoint(constGeoPoint&other)=default

Copy constructor,GeoPoint is trivially copyable.

GeoPoint

GeoPoint(GeoPoint&&other)=default

Move constructor, equivalent to copying.

ToString

std::stringToString()const

longitude

doublelongitude()const

Returns the latitude value of thisGeoPoint.

operator=

GeoPoint&operator=(constGeoPoint&other)=default

Copy assignment operator,GeoPoint is trivially copyable.

operator=

GeoPoint&operator=(GeoPoint&&other)=default

Move assignment operator, equivalent to copying.

Friend classes

operator<<

friendstd::ostream&operator<<(std::ostream&out,constGeoPoint&geo_point)

Outputs the string representation of thisGeoPoint to the given stream.

See also:ToString() for comments on the representation format.

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 2024-01-23 UTC.