Struct GeoPoint
Represents a point geometry.
Implements
Namespace: Realms
Assembly: Realm.dll
Syntax
public readonly struct GeoPoint : IEquatable<GeoPoint>
Remarks
This type cannot be used for persistence - i.e. you can't declare a Realm property that is of type GeoPoint. It is only used as a building block for the geospatial shape types, such as GeoBox, GeoCircle, and GeoPolygon.
Constructors
| Edit this page View SourceGeoPoint(double, double)
Initializes a new instance of the GeoPoint struct with the provided coordinates.
Declaration
public GeoPoint(double latitude, double longitude)
Parameters
Type | Name | Description |
---|---|---|
double | latitude | The latitude of the point. |
double | longitude | The longitude of the point. |
Properties
| Edit this page View SourceLatitude
Gets the latitude of the point.
Declaration
public double Latitude { get; }
Property Value
Type | Description |
---|---|
double | The point's latitude. |
Longitude
Gets the longitude of the point.
Declaration
public double Longitude { get; }
Property Value
Type | Description |
---|---|
double | The point's longitude. |
Methods
| Edit this page View SourceEquals(GeoPoint)
Declaration
public bool Equals(GeoPoint other)
Parameters
Type | Name | Description |
---|---|---|
GeoPoint | other | An object to compare with this GeoPoint. |
Returns
Type | Description |
---|---|
bool | trueif the current point's latitude and longitude are
equal to the |
ToString()
Returns a string representation of the value.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string representation of the value. |
Overrides
Operators
| Edit this page View Sourceoperator ==(GeoPoint, GeoPoint)
Compares two GeoPoint instances for equality.
Declaration
public static bool operator ==(GeoPoint left, GeoPoint right)
Parameters
Type | Name | Description |
---|---|---|
GeoPoint | left | The first GeoPoint. |
GeoPoint | right | The second GeoPoint. |
Returns
Type | Description |
---|---|
bool |
|
implicit operator GeoPoint((double Latitude, double Longitude))
Converts a tuple containing latitude and longitude to GeoPoint.
Declaration
public static implicit operator GeoPoint((double Latitude, double Longitude) tuple)
Parameters
Type | Name | Description |
---|---|---|
(double Latitude, double Longitude) | tuple | The tuple consisting of two coordinates. |
Returns
Type | Description |
---|---|
GeoPoint | A GeoPoint with latitude equal to the first element of the tuple and longitude equal to the second element. |
operator !=(GeoPoint, GeoPoint)
Compares two GeoPoint instances for inequality.
Declaration
public static bool operator !=(GeoPoint left, GeoPoint right)
Parameters
Type | Name | Description |
---|---|---|
GeoPoint | left | The first GeoPoint. |
GeoPoint | right | The second GeoPoint. |
Returns
Type | Description |
---|---|
bool |
|