Edit

Share via


PositionProvider.TryGetCurrentPosition Method

Definition

Overloads

TryGetCurrentPosition(GeographicPosition, Angle, Speed, Nullable<Angle>)

Get the current position from the latest message containing any of the relevant data parts. This does not extrapolate the position if the last received message is old

TryGetCurrentPosition(GeographicPosition, Boolean, Angle, Speed, Nullable<Angle>)

Get the current position from the latest message containing any of the relevant data parts. If extrapolate is true, the speed and direction are used to extrapolate the position (many older GNSS receivers only deliver the position at 1Hz or less)

TryGetCurrentPosition(GeographicPosition, String, Boolean, Angle, Speed, Nullable<Angle>, DateTimeOffset)

Get the current position from the latest message containing any of the relevant data parts. If extrapolate is true, the speed and direction are used to extrapolate the position (many older GNSS receivers only deliver the position at 1Hz or less)

TryGetCurrentPosition(GeographicPosition, String, Boolean, Angle, Speed, Nullable<Angle>, DateTimeOffset, DateTimeOffset)

Get the current position from the latest message containing any of the relevant data parts. If extrapolate is true, the speed and direction are used to extrapolate the position (many older GNSS receivers only deliver the position at 1Hz or less)

TryGetCurrentPosition(GeographicPosition, Angle, Speed, Nullable<Angle>)

Get the current position from the latest message containing any of the relevant data parts. This does not extrapolate the position if the last received message is old

public bool TryGetCurrentPosition (out Iot.Device.Common.GeographicPosition? position, out UnitsNet.Angle track, out UnitsNet.Speed sog, out UnitsNet.Angle? heading);
member this.TryGetCurrentPosition : GeographicPosition * Angle * Speed * Nullable -> bool
Public Function TryGetCurrentPosition (ByRef position As GeographicPosition, ByRef track As Angle, ByRef sog As Speed, ByRef heading As Nullable(Of Angle)) As Boolean

Parameters

position
GeographicPosition

Current position

track
UnitsNet.Angle

Track (course over ground)

sog
UnitsNet.Speed

Speed over ground

heading
Nullable<UnitsNet.Angle>

Vessel Heading

Returns

True if a valid position is returned

Applies to

TryGetCurrentPosition(GeographicPosition, Boolean, Angle, Speed, Nullable<Angle>)

Get the current position from the latest message containing any of the relevant data parts. If extrapolate is true, the speed and direction are used to extrapolate the position (many older GNSS receivers only deliver the position at 1Hz or less)

public bool TryGetCurrentPosition (out Iot.Device.Common.GeographicPosition? position, bool extrapolate, out UnitsNet.Angle track, out UnitsNet.Speed sog, out UnitsNet.Angle? heading);
member this.TryGetCurrentPosition : GeographicPosition * bool * Angle * Speed * Nullable -> bool
Public Function TryGetCurrentPosition (ByRef position As GeographicPosition, extrapolate As Boolean, ByRef track As Angle, ByRef sog As Speed, ByRef heading As Nullable(Of Angle)) As Boolean

Parameters

position
GeographicPosition

Current position

extrapolate
Boolean

True to extrapolate the current position using speed and track

track
UnitsNet.Angle

Track (course over ground)

sog
UnitsNet.Speed

Speed over ground

heading
Nullable<UnitsNet.Angle>

Vessel Heading

Returns

True if a valid position is returned

Applies to

TryGetCurrentPosition(GeographicPosition, String, Boolean, Angle, Speed, Nullable<Angle>, DateTimeOffset)

Get the current position from the latest message containing any of the relevant data parts. If extrapolate is true, the speed and direction are used to extrapolate the position (many older GNSS receivers only deliver the position at 1Hz or less)

public bool TryGetCurrentPosition (out Iot.Device.Common.GeographicPosition? position, string? source, bool extrapolate, out UnitsNet.Angle track, out UnitsNet.Speed sog, out UnitsNet.Angle? heading, out DateTimeOffset messageTime);
member this.TryGetCurrentPosition : GeographicPosition * string * bool * Angle * Speed * Nullable * DateTimeOffset -> bool
Public Function TryGetCurrentPosition (ByRef position As GeographicPosition, source As String, extrapolate As Boolean, ByRef track As Angle, ByRef sog As Speed, ByRef heading As Nullable(Of Angle), ByRef messageTime As DateTimeOffset) As Boolean

Parameters

position
GeographicPosition

Current position

source
String

Only look at this source (otherwise, if multiple sources provide a position, any is used)

extrapolate
Boolean

True to extrapolate the current position using speed and track

track
UnitsNet.Angle

Track (course over ground)

sog
UnitsNet.Speed

Speed over ground

heading
Nullable<UnitsNet.Angle>

Vessel Heading

messageTime
DateTimeOffset

Time of the position report that was used

Returns

True if a valid position is returned

Applies to

TryGetCurrentPosition(GeographicPosition, String, Boolean, Angle, Speed, Nullable<Angle>, DateTimeOffset, DateTimeOffset)

Get the current position from the latest message containing any of the relevant data parts. If extrapolate is true, the speed and direction are used to extrapolate the position (many older GNSS receivers only deliver the position at 1Hz or less)

public bool TryGetCurrentPosition (out Iot.Device.Common.GeographicPosition? position, string? source, bool extrapolate, out UnitsNet.Angle track, out UnitsNet.Speed sog, out UnitsNet.Angle? heading, out DateTimeOffset messageTime, DateTimeOffset now);
member this.TryGetCurrentPosition : GeographicPosition * string * bool * Angle * Speed * Nullable * DateTimeOffset * DateTimeOffset -> bool
Public Function TryGetCurrentPosition (ByRef position As GeographicPosition, source As String, extrapolate As Boolean, ByRef track As Angle, ByRef sog As Speed, ByRef heading As Nullable(Of Angle), ByRef messageTime As DateTimeOffset, now As DateTimeOffset) As Boolean

Parameters

position
GeographicPosition

Current position

source
String

Only look at this source (otherwise, if multiple sources provide a position, any is used)

extrapolate
Boolean

True to extrapolate the current position using speed and track

track
UnitsNet.Angle

Track (course over ground)

sog
UnitsNet.Speed

Speed over ground

heading
Nullable<UnitsNet.Angle>

Vessel Heading

messageTime
DateTimeOffset

Time of the position report that was used

now
DateTimeOffset

The current time (when working with data in the past, this may be the a time within that data set)

Returns

True if a valid position is returned

Applies to