Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
 /// <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);
     }
 }
Ejemplo n.º 3
0
 public DmsLocation(DmsPoint latitude, DmsPoint longitude)
 {
     Latitude  = latitude;
     Longitude = longitude;
 }