GeographicPosition Class
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.
Represents a position in WGS84 coordinates. This is the standard coordinate format for most GNSS receivers currently available. An instance with Latitude = Longitude = Height = 0 is considered invalid. A real GNSS receiver will never output this exact value and that position is far out in the ocean.
[System.Serializable]
public sealed class GeographicPosition : ICloneable, IEquatable<Iot.Device.Common.GeographicPosition>
[System.Serializable]
public sealed class GeographicPosition : ICloneable, IEquatable<Iot.Device.Common.GeographicPosition>, IFormattable
[<System.Serializable>]
type GeographicPosition = class
interface ICloneable
interface IEquatable<GeographicPosition>
[<System.Serializable>]
type GeographicPosition = class
interface ICloneable
interface IEquatable<GeographicPosition>
interface IFormattable
Public NotInheritable Class GeographicPosition
Implements ICloneable, IEquatable(Of GeographicPosition)
Public NotInheritable Class GeographicPosition
Implements ICloneable, IEquatable(Of GeographicPosition), IFormattable
- Inheritance
-
GeographicPosition
- Attributes
- Implements
Remarks
This object stores ellipsoidal height, depending on the GNSS receiver and the application, this needs to be transformed to geoidal height.
Constructors
GeographicPosition() |
Initializes an empty geographic position |
GeographicPosition(Double, Double, Double) |
Creates a GeographicPosition instance from latitude, longitude and ellipsoidal height. |
GeographicPosition(GeographicPosition) |
Copy constructor |
Properties
EllipsoidalHeight |
Height over the WGS84 ellipsoid |
Latitude |
Latitude. Positive for north of equator, negative for south. |
Longitude |
Longitude. Positive for east of Greenwich, negative for west. |
Methods
Clone() |
Creates a copy of this instance |
ContainsValidPosition() |
Returns true if this instance contains a valid position. An invalid position is either when Latitude and Longitude and EllipsoidalHeight are exactly zero, when either value is NaN or when the position is out of range. |
EqualPosition(GeographicPosition, Double) |
Returns true if the two positions are (almost) equal. This ignores the altitude. |
Equals(GeographicPosition) |
Equality comparer. Compares the two positions for equality within about 1cm. |
Equals(Object) |
Equality comparer. Compares the two positions for equality within about 1cm. |
GetDegreesMinutes(Double, Int32, Double, Int32, Double) |
Returns the given angle as degree and minutes |
GetDegreesMinutesSeconds(Double, Int32, Double, Double, Double, Double) |
Returns the given angle as degrees, minutes and seconds |
GetDegreesMinutesSeconds(Double, Int32, Double, Int32, Int32, Double) |
Returns the given angle as degrees, minutes and seconds |
GetHashCode() | Serves as the default hash function. |
ToString() |
Returns a string representation of this position. |
ToString(String, IFormatProvider) |
Formats this GeographicPosition instance to a string. The format string can contain up to three groups of format identifiers of the form "Xn", where X is one of
|
Operators
Equality(GeographicPosition, GeographicPosition) |
Equality operator. See Equals(GeographicPosition) |
Inequality(GeographicPosition, GeographicPosition) |
Inequality operator. See Equals(GeographicPosition) |
Explicit Interface Implementations
ICloneable.Clone() |
Extension Methods
DirectionTo(GeographicPosition, GeographicPosition) |
Calculates the initial angle to travel to get to another position. Calculates on the great circle, therefore the direction to the target is not constant along the path |
DistanceTo(GeographicPosition, GeographicPosition) |
Calculate the distance to another position |
MoveBy(GeographicPosition, Angle, Length) |
Move a certain distance into a direction. Where do I end? |
NormalizeLongitudeTo180Degrees(GeographicPosition) |
Normalizes the longitude to +/- 180° This is the common form for displaying longitudes. NormalizeLongitudeTo360Degrees(GeographicPosition) is used when the area of interest is close to the date border (in the pacific ocean) |
NormalizeLongitudeTo360Degrees(GeographicPosition) |
Normalizes the longitude to [0..360°) This coordinate form is advised if working in an area near the date border in the pacific ocean. |