public struct GeoPoint : IEquatable<GeoPoint>Reference documentation and code samples for the Firestore API struct GeoPoint.
Immutable struct representing a geographic location in Firestore.
Implements
IEquatableGeoPointNamespace
Google.Cloud.FirestoreAssembly
Google.Cloud.Firestore.dll
Constructors
GeoPoint(double, double)
public GeoPoint(double latitude, double longitude)Creates a new value using the provided latitude and longitude values.
| Parameters | |
|---|---|
| Name | Description |
latitude |
doubleThe latitude of the point in degrees, between -90 and 90 inclusive. |
longitude |
doubleThe longitude of the point in degrees, between -180 and 180 inclusive. |
Properties
Latitude
public double Latitude { get; }The latitude, in degrees, in the range -90 to 90 inclusive.
| Property Value | |
|---|---|
| Type | Description |
double |
|
Longitude
public double Longitude { get; }The longitude, in degrees, in the range -180 to 180 inclusive.
| Property Value | |
|---|---|
| Type | Description |
double |
|
Methods
FromProto(LatLng)
public static GeoPoint FromProto(LatLng proto)Creates an instance from a Protobuf LatLng representation. Later modifications to the Protobuf representation will not affect the returned object.
| Parameter | |
|---|---|
| Name | Description |
proto |
LatLngA Protobuf location representation. |
| Returns | |
|---|---|
| Type | Description |
GeoPoint |
A new GeoPoint value. |
GetHashCode()
public override int GetHashCode()| Returns | |
|---|---|
| Type | Description |
int |
|
ToProto()
public LatLng ToProto()Creates a Protobuf LatLng representation of this point. Modifications to the returned message will not be reflected in this object.
| Returns | |
|---|---|
| Type | Description |
LatLng |
A Protobuf location representation. |
ToString()
public override string ToString()| Returns | |
|---|---|
| Type | Description |
string |
|
Operators
operator ==(GeoPoint, GeoPoint)
public static bool operator ==(GeoPoint lhs, GeoPoint rhs)Operator overload to compare two GeoPoint values for equality.
| Parameters | |
|---|---|
| Name | Description |
lhs |
GeoPointLeft value to compare |
rhs |
GeoPointRight value to compare |
| Returns | |
|---|---|
| Type | Description |
bool |
true if |
operator !=(GeoPoint, GeoPoint)
public static bool operator !=(GeoPoint lhs, GeoPoint rhs)Operator overload to compare two GeoPoint values for inequality.
| Parameters | |
|---|---|
| Name | Description |
lhs |
GeoPointLeft value to compare |
rhs |
GeoPointRight value to compare |
| Returns | |
|---|---|
| Type | Description |
bool |
false if |