Crs.FormatLatitudeAsDegreesMinutes Method
Formats a latitude as degrees, minutes and hemisphere.
FormatLatitudeAsDegreesMinutes(System.Double latitude, System.Int32 minuteDecimals)
Formats a latitude as degrees, minutes and hemisphere.Syntax
public static StringCollection FormatLatitudeAsDegreesMinutes (
System.Double latitude,
System.Int32 minuteDecimals
)
Parameters
A latitude in degrees (positive north).
The number of decimals for the minutes.
Return Value
A collection of three strings, representing degrees, minutes and hemisphere.
Remarks
The method will return three empty strings if the latitude parameter is not in the range -90 to +90 degrees. Actually, an excess of 0.0000001 degrees (about 1 cm) is accepted and will be discarded.
The first string of the result collection will be the degrees represented as an unsigned two-digit integer, at most 90. If less than 10, the integer will be zero-padded at the left, to contain exactly two 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, "N" for north and "S" for south. (Latitudes are considered to be positive north.)
minuteDecimals | latitude resolution |
---|---|
0 | 1.85 km |
1 | 185 m |
2 | 18 m |
3 | 1.8 m |
4 | 0.18 m |
5 | 0.018 m |
Platforms
Windows, Linux, Android