public static decimal CalculateDecimal(DmsPoint point) { if (point == null) { return(default(decimal)); } return(Math.Round(point.Degrees + (decimal)point.Minutes / 60 + (decimal)point.Seconds / 3600, 6)); }
/// <summary> /// Gets latitude or longitude decimal and degree display values. /// </summary> /// <param name="value">The latitude or longitude value in decimal.</param> /// <param name="type">The type of the decimal value.</param> /// <returns>A string representing the latitude's decimal and degree values combined.</returns> private static string GetLatitudeLongitudeDisplayValue(double?value, LocationPointValueType type) { if (value.HasValue && !double.IsNaN(value.Value)) { string display = value.Value.ToString(); var dms = new DmsPoint(value.Value, type); return($"{value} / {dms.Degree}°{dms.Minute}'{dms.Second}'' {dms.Direction}"); } else { return(UnknownValue); } }
public DmsLocation(DmsPoint latitude, DmsPoint longitude) { Latitude = latitude; Longitude = longitude; }