[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-01-23 UTC."],[],[],null,["# firebase::firestore::GeoPoint Class Reference\n\nfirebase::firestore::GeoPoint\n=============================\n\n\n`#include \u003cgeo_point.h\u003e`\n\nAn immutable object representing a geographical point in [Firestore](/docs/reference/cpp/class/firebase/firestore/firestore#classfirebase_1_1firestore_1_1_firestore).\n\nSummary\n-------\n\nThe point is represented as a latitude/longitude pair.\n\nLatitude values are in the range of \\[-90, 90\\]. Longitude values are in the range of \\[-180, 180\\].\n\n| ### Constructors and Destructors ||\n|---|---|\n| [GeoPoint](#classfirebase_1_1firestore_1_1_geo_point_1abeaa0258595983ace6e0c0a833272a32)`()` Creates a [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point) with both latitude and longitude set to 0. ||\n| [GeoPoint](#classfirebase_1_1firestore_1_1_geo_point_1af75b37aa89a82c258ff670313b563e49)`(double latitude, double longitude)` Creates a [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point) from the provided latitude and longitude values. ||\n| [GeoPoint](#classfirebase_1_1firestore_1_1_geo_point_1a0ec4d648318c335388b14e7878aa5070)`(const `[GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point)` & other)` Copy constructor, [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point) is trivially copyable. ||\n| [GeoPoint](#classfirebase_1_1firestore_1_1_geo_point_1a2e6c4a10f17fcb0bcce7836dff813755)`(`[GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point)` && other)` Move constructor, equivalent to copying. ||\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ToString](#classfirebase_1_1firestore_1_1_geo_point_1ab4704568b6f925a4fcc825cce5285d58)`() const ` | `std::string` Returns a string representation of this [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point) for logging/debugging purposes. |\n| [latitude](#classfirebase_1_1firestore_1_1_geo_point_1a161b2857f46a46f9e1f4c94ae493d776)`() const ` | `double` Returns the latitude value of this [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point). |\n| [longitude](#classfirebase_1_1firestore_1_1_geo_point_1a52f379541316f6ad12fc8b7e6b5b5725)`() const ` | `double` Returns the latitude value of this [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point). |\n| [operator=](#classfirebase_1_1firestore_1_1_geo_point_1a2c0be427f41b902e156009e0962ee612)`(const `[GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point)` & other)=default` | [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point)` &` Copy assignment operator, [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point) is trivially copyable. |\n| [operator=](#classfirebase_1_1firestore_1_1_geo_point_1ae1b1e4f4c167ef3b1b2889c0b2225f01)`(`[GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point)` && other)=default` | [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point)` &` Move assignment operator, equivalent to copying. |\n\n| ### Friend classes ||\n|--------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [operator\u003c\u003c](#classfirebase_1_1firestore_1_1_geo_point_1a3c417a204df76e7ba637858a24c22006) | `friend std::ostream &` Outputs the string representation of this [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point) to the given stream. |\n\nPublic functions\n----------------\n\n### GeoPoint\n\n```c++\n GeoPoint()=default\n``` \nCreates a [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point) with both latitude and longitude set to 0. \n\n### GeoPoint\n\n```c++\n GeoPoint(\n double latitude,\n double longitude\n)\n``` \nCreates a [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point) from the provided latitude and longitude values.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |-------------|----------------------------------------------------------| | `latitude` | The latitude as number of degrees between -90 and 90. | | `longitude` | The longitude as number of degrees between -180 and 180. | |\n\n### GeoPoint\n\n```c++\n GeoPoint(\n const GeoPoint & other\n)=default\n``` \nCopy constructor, [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point) is trivially copyable. \n\n### GeoPoint\n\n```c++\n GeoPoint(\n GeoPoint && other\n)=default\n``` \nMove constructor, equivalent to copying. \n\n### ToString\n\n```c++\nstd::string ToString() const \n``` \nReturns a string representation of this [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point) for logging/debugging purposes.\n\n\n| **Note:** : the exact string representation is unspecified and subject to change; don't rely on the format of the string.\n\n\u003cbr /\u003e\n\n### latitude\n\n```c++\ndouble latitude() const \n``` \nReturns the latitude value of this [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point). \n\n### longitude\n\n```c++\ndouble longitude() const \n``` \nReturns the latitude value of this [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point). \n\n### operator=\n\n```c++\nGeoPoint & operator=(\n const GeoPoint & other\n)=default\n``` \nCopy assignment operator, [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point) is trivially copyable. \n\n### operator=\n\n```c++\nGeoPoint & operator=(\n GeoPoint && other\n)=default\n``` \nMove assignment operator, equivalent to copying.\n\nFriend classes\n--------------\n\n### operator\\\u003c\\\u003c\n\n```c++\nfriend std::ostream & operator\u003c\u003c(std::ostream &out, const GeoPoint &geo_point)\n``` \nOutputs the string representation of this [GeoPoint](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point) to the given stream.\n\n**See also:** [ToString()](/docs/reference/cpp/class/firebase/firestore/geo-point#classfirebase_1_1firestore_1_1_geo_point_1ab4704568b6f925a4fcc825cce5285d58) for comments on the representation format."]]