Beispiel #1
0
        /// <summary>
        /// Calculates the distance to a 'Maidenhead Locator'.
        /// </summary>
        /// <param name="maidenheadLocator">The 'Maidenhead Locator'.</param>
        /// <param name="positionInRectangle">>The position of the geographical coordinates in the locator.</param>
        /// <returns>The distance in km.</returns>
        /// <exception cref="ArgumentException">
        /// If the length of the locator text is null or not an even number.
        /// If the locator text contains invalid characters.
        /// </exception>
        public double GetDistance(string maidenheadLocator, PositionInRectangle positionInRectangle)
        {
            GeographicalPoint geographicalPoint = new GeographicalPoint(maidenheadLocator, positionInRectangle);
            double            result            = GetDistance(geographicalPoint);

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Gives a new List instance for a single <see cref="GeographicalPoint" /> instance.
        /// </summary>
        /// <param name="geographicalPoint">The <see cref="GeographicalPoint" /> instance.</param>
        /// <returns>The new List instance.</returns>
        public static IEnumerable <GeographicalPoint> GetNewList(GeographicalPoint geographicalPoint)
        {
            var result = new List <GeographicalPoint>();

            if (geographicalPoint != null)
            {
                result.Add(geographicalPoint);
            }

            return(result);
        }
Beispiel #3
0
 /// <summary>
 /// Checks if two given locations (by GeographicalPoint) are equal
 /// </summary>
 /// <param name="point1">The 1st location.</param>
 /// <param name="point2">The 2nd location.</param>
 /// <returns>True if the given locations are equal .</returns>
 public static bool IsEqual(GeographicalPoint point1, GeographicalPoint point2)
 {
     return(IsEqual(point1.Latitude, point1.Longitude, point2.Latitude, point2.Longitude));
 }