Crs.FormatLongitudeAsDegreesMinutes Method
Formats a longitude as degrees, minutes and hemisphere.
FormatLongitudeAsDegreesMinutes(System.Double longitude, System.Int32 minuteDecimals)
Formats a longitude as degrees, minutes and hemisphere.Syntax
public static StringCollection FormatLongitudeAsDegreesMinutes (
System.Double longitude,
System.Int32 minuteDecimals
)
Parameters
A longitude in degrees (positive east).
The number of decimals for the minutes.
Return Value
A collection of three strings, representing degrees, minutes and hemisphere.
Remarks
The method will not normalize the longitude into the 180°W to 180°E range (that is up to the application). But the method will return three empty strings if the longitude parameter is not in the range -999.5 to +999.5 degrees.
The first string of the result collection will be the degrees represented as an unsigned three-digit integer, at most 999. If less than 100, the integer will be zero-padded at the left, to contain exactly three digits.
The second string of the result collection will represent the minutes as an unsigned real number, at most 59.999..., with as many decimals as specified by the minuteDecimals parameter (see table below). If the integer part is less than 10, it will be zero-padded to contain exactly two digits. The decimal separator will be a dot regardless of numeric locale.
The third string of the result collection will represent the hemisphere, "E" for east and "W" for west. (Longitudes are considered to be positive east.)
minuteDecimals | longitude resolution |
---|---|
0 | 1.85 km |
1 | 185 m |
2 | 18 m |
3 | 1.8 m |
4 | 0.18 m |
5 | 0.018 m |
Note: the resolution table is valid around the equator. On higher latitudes, the longitude resolution is better by a factor of cos(lat). For example, to get the longitude resolution near Stockholm, multiply by cos(59°) = 0.5, or near Longyearbyen, multiply by cos(78°) = 0.2.
Platforms
Windows, Linux, Android