Struct GeoPoint (2.5.0)

public struct GeoPoint : IEquatable<GeoPoint>

Immutable struct representing a geographic location in Firestore.

Implements

IEquatable<GeoPoint>

Namespace

Google.Cloud.Firestore

Assembly

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
NameDescription
latitudeDouble

The latitude of the point in degrees, between -90 and 90 inclusive.

longitudeDouble

The 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
TypeDescription
Double

Longitude

public double Longitude { get; }

The longitude, in degrees, in the range -180 to 180 inclusive.

Property Value
TypeDescription
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
NameDescription
protoLatLng

A Protobuf location representation.

Returns
TypeDescription
GeoPoint

A new GeoPoint value.

GetHashCode()

public override int GetHashCode()
Returns
TypeDescription
Int32
Overrides

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
TypeDescription
LatLng

A Protobuf location representation.

ToString()

public override string ToString()
Returns
TypeDescription
String
Overrides

Operators

Equality(GeoPoint, GeoPoint)

public static bool operator ==(GeoPoint lhs, GeoPoint rhs)

Operator overload to compare two GeoPoint values for equality.

Parameters
NameDescription
lhsGeoPoint

Left value to compare

rhsGeoPoint

Right value to compare

Returns
TypeDescription
Boolean

true if lhs is equal to rhs; otherwise false.

Inequality(GeoPoint, GeoPoint)

public static bool operator !=(GeoPoint lhs, GeoPoint rhs)

Operator overload to compare two GeoPoint values for inequality.

Parameters
NameDescription
lhsGeoPoint

Left value to compare

rhsGeoPoint

Right value to compare

Returns
TypeDescription
Boolean

false if lhs is equal to rhs; otherwise true.