Struct H3DirectedEdge
A 64-bit H3 directed-edge index, identifying one of the directed boundary edges from an origin cell to one of its neighbors. All public coordinates exposed through its members are in degrees.
public readonly record struct H3DirectedEdge : IEquatable<H3DirectedEdge>
- Implements
- Inherited Members
Constructors
H3DirectedEdge(ulong)
A 64-bit H3 directed-edge index, identifying one of the directed boundary edges from an origin cell to one of its neighbors. All public coordinates exposed through its members are in degrees.
public H3DirectedEdge(ulong Value)
Parameters
ValueulongThe raw 64-bit H3 directed-edge index value.
Properties
IsNull
Gets a value indicating whether this is the Null sentinel (raw value 0).
public bool IsNull { get; }
Property Value
Null
Gets the sentinel "null" edge (raw value 0), representing an invalid or absent directed edge.
public static H3DirectedEdge Null { get; }
Property Value
Value
The raw 64-bit H3 directed-edge index value.
public ulong Value { get; init; }
Property Value
Methods
Deconstruct(out H3Index, out H3Index)
Deconstructs this directed edge into its origin and destination cells.
public void Deconstruct(out H3Index origin, out H3Index destination)
Parameters
Exceptions
- H3InvalidIndexException
This is not a valid directed edge.
EdgeLengthKm()
Returns the length of this directed edge in kilometers.
public double EdgeLengthKm()
Returns
- double
The edge length in kilometers.
Exceptions
- H3InvalidIndexException
This is not a valid directed edge.
EdgeLengthM()
Returns the length of this directed edge in meters.
public double EdgeLengthM()
Returns
- double
The edge length in meters.
Exceptions
- H3InvalidIndexException
This is not a valid directed edge.
EdgeLengthRads()
Returns the length of this directed edge in radians.
public double EdgeLengthRads()
Returns
- double
The edge length in radians.
Exceptions
- H3InvalidIndexException
This is not a valid directed edge.
GetDestination()
Returns the destination cell of this directed edge.
public H3Index GetDestination()
Returns
Exceptions
- H3InvalidIndexException
This is not a valid directed edge.
GetOrigin()
Returns the origin cell of this directed edge.
public H3Index GetOrigin()
Returns
Exceptions
- H3InvalidIndexException
This is not a valid directed edge.
IsValid()
Returns a value indicating whether the native library considers this a valid H3 directed-edge index. This never throws, even for an arbitrary raw value.
public bool IsValid()
Returns
IsValid(ulong)
Returns a value indicating whether the native library considers a raw value a valid H3 directed-edge index. This never throws.
public static bool IsValid(ulong value)
Parameters
valueulongThe raw 64-bit value to test.
Returns
Reverse()
Returns the directed edge pointing in the opposite direction (from this edge's destination back to its origin).
public H3DirectedEdge Reverse()
Returns
- H3DirectedEdge
The reversed H3DirectedEdge.
Exceptions
- H3InvalidIndexException
This is not a valid directed edge.
ToBoundary()
Returns the boundary vertices of this directed edge in order from origin to destination.
public IReadOnlyList<LatLng> ToBoundary()
Returns
- IReadOnlyList<LatLng>
The boundary vertices, in degrees (usually 2, more when the edge crosses an icosahedron face). The result may straddle the antimeridian and is not normalized.
Exceptions
- H3InvalidIndexException
This is not a valid directed edge.
ToCells()
Returns the origin and destination cells of this directed edge.
public (H3Index Origin, H3Index Destination) ToCells()
Returns
- (H3Index Origin, H3Index Destination)
A tuple of the origin and destination H3Index cells.
Exceptions
- H3InvalidIndexException
This is not a valid directed edge.