Crs.FormatLatitudeAsDegreesMinutesSeconds Method
Formats a latitude as degrees, minutes, seconds and hemisphere.
FormatLatitudeAsDegreesMinutesSeconds(System.Double latitude, System.Int32 secondDecimals)
Formats a latitude as degrees, minutes, seconds and hemisphere.Syntax
public static StringCollection FormatLatitudeAsDegreesMinutesSeconds (
System.Double latitude,
System.Int32 secondDecimals
)
Parameters
A latitude in degrees (positive north).
The number of decimals for the seconds.
Return Value
A collection of four strings, representing degrees, minutes, seconds and hemisphere.
Remarks
The method will return four 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 be the minutes represented as an unsigned two-digit integer, at most 59. If less than 10, the integer will be zero-padded at the left, to contain exactly two digits.
The third string of the result collection will represent the seconds as an unsigned real number, at most 59.999..., with as many decimals as specified by the secondDecimals 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 fourth string of the result collection will represent the hemisphere, "N" for north and "S" for south. (Latitudes are considered to be positive north.)
secondDecimals | latitude resolution |
---|---|
0 | 30 m |
1 | 3 m |
2 | 0.3 m |
3 | 0.03 m |
4 | 0.003 m |
Platforms
Windows, Linux, Android