Firestore API - Struct GeoPoint (3.5.0)

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

IEquatableGeoPoint

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 the hash code for this instance.

Returns
TypeDescription
int

A 32-bit signed integer that is the hash code for this instance.

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 the fully qualified type name of this instance.

Returns
TypeDescription
string

The fully qualified type name.

Overrides

Operators

operator ==(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
bool

true if lhs is equal to rhs; otherwise false.

operator !=(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
bool

false if lhs is equal to rhs; otherwise true.