PositionProvider.TryGetCurrentPosition Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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 |
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 |
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 |
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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for