public struct GeoPoint : IEquatable<GeoPoint>
Immutable struct representing a geographic location in Firestore.
Implements
IEquatable<GeoPoint>Namespace
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 | Double The latitude of the point in degrees, between -90 and 90 inclusive. |
longitude | Double The longitude of the point in degrees, between -180 and 180 inclusive. |
Properties
Latitude
public readonly double Latitude { get; }
The latitude, in degrees, in the range -90 to 90 inclusive.
Property Value | |
---|---|
Type | Description |
Double |
Longitude
public readonly 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 | LatLng A Protobuf location representation. |
Returns | |
---|---|
Type | Description |
GeoPoint | A new GeoPoint value. |
GetHashCode()
public override int GetHashCode()
Returns | |
---|---|
Type | Description |
Int32 |
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
Equality(GeoPoint, GeoPoint)
public static bool operator ==(GeoPoint lhs, GeoPoint rhs)
Operator overload to compare two GeoPoint values for equality.
Parameters | |
---|---|
Name | Description |
lhs | GeoPoint Left value to compare |
rhs | GeoPoint Right value to compare |
Returns | |
---|---|
Type | Description |
Boolean | true if |
Inequality(GeoPoint, GeoPoint)
public static bool operator !=(GeoPoint lhs, GeoPoint rhs)
Operator overload to compare two GeoPoint values for inequality.
Parameters | |
---|---|
Name | Description |
lhs | GeoPoint Left value to compare |
rhs | GeoPoint Right value to compare |
Returns | |
---|---|
Type | Description |
Boolean | false if |