示例#1
0
        /// <summary>
        /// Determines if the point is within the specified distance from the polygon.
        /// </summary>
        /// <param name="point"></param>
        /// <param name="polygon"></param>
        /// <param name="distance"></param>
        /// <returns></returns>
        public static bool WithinDistance(this Point point, Polygon polygon, double distance)
        {
            if (Null(point, polygon))
                return false;

            return point.Extent().Buffer(distance).Intersects(polygon.Extent()) && point.Distance(polygon) < distance;
        }
示例#2
0
        /// <summary>
        /// Determines if the polygon is within the specified distance from the other polygon.
        /// </summary>
        /// <param name="polygon1"></param>
        /// <param name="polygon2"></param>
        /// <param name="distance"></param>
        /// <returns></returns>
        public static bool WithinDistance(this Polygon polygon1, Polygon polygon2, double distance)
        {
            if (Null(polygon1, polygon2))
                return false;

            return polygon1.Extent().Buffer(distance).Intersects(polygon2.Extent()) && polygon1.Distance(polygon2) < distance;
        }