Esempio n. 1
0
 /// <summary>
 ///     Calculates geo-spatial distance between two locations.
 /// </summary>
 /// <param name="p1">The first point.</param>
 /// <param name="p2">The second point.</param>
 /// <param name="unit">
 ///     The desired distance measurement unit.
 /// </param>
 public static double GetDistance(
     GeoSpatialPoint p1,
     GeoSpatialPoint p2,
     GeoSpatialDistanceUnit unit = GeoSpatialDistanceUnit.NauticalMile)
 {
     return(GetDistance(
                p1.Latitude,
                p1.Longitude,
                p2.Latitude,
                p2.Longitude,
                unit));
 }
Esempio n. 2
0
 /// <summary>
 ///     Verifies if a given vector point is contained in a given polygon of points.
 /// </summary>
 /// <param name="point">The originating point.</param>
 /// <param name="polygonPoints">The polygon points. A minimum of three is required.</param>
 public static bool IsPointInPolygon(GeoSpatialPoint point, IEnumerable <GeoSpatialPoint> polygonPoints)
 {
     return(IsPointInPolygon(point.ToVector(), polygonPoints?.Select(p => p.ToVector())));
 }