Firestore API - Struct GeoPoint (3.6.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
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 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 LatLng

A Protobuf location representation.

Returns
Type Description
GeoPoint

A new GeoPoint value.

GetHashCode()

public override int GetHashCode()
Returns
Type Description
int
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
Type Description
LatLng

A Protobuf location representation.

ToString()

public override string ToString()
Returns
Type Description
string
Overrides

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 GeoPoint

Left value to compare

rhs GeoPoint

Right value to compare

Returns
Type Description
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
Name Description
lhs GeoPoint

Left value to compare

rhs GeoPoint

Right value to compare

Returns
Type Description
bool

false if lhs is equal to rhs; otherwise true.