public static bool ExecuteBoolean(IPolygon poly1, IPolygon poly2)
        {
            foreach (IPoint point in poly1.GetCoordinates().First())
            {
                if (PointInPolygon.Execute(point, poly2))
                {
                    return(true);
                }
            }
            foreach (IPoint point in poly2.GetCoordinates().First())
            {
                if (PointInPolygon.Execute(point, poly1))
                {
                    return(true);
                }
            }

            IEnumerable <IPoint> intersections = LineIntersect.Execute(PolygonToLine.Execute(poly1), PolygonToLine.Execute(poly2));

            if (intersections != null && intersections.Count() > 0)
            {
                return(true);
            }
            return(false);
        }
        public static IEnumerable <IPoint> Execute(IPolygon poly1, IPolygon poly2)
        {
            foreach (IPoint point in poly1.GetCoordinates().First())
            {
                if (PointInPolygon.Execute(point, poly2))
                {
                    yield return(point);
                }
            }
            foreach (IPoint point in poly2.GetCoordinates().First())
            {
                if (PointInPolygon.Execute(point, poly1))
                {
                    yield return(point);
                }
            }
            IEnumerable <IPoint> intersections = LineIntersect.Execute(PolygonToLine.Execute(poly1), PolygonToLine.Execute(poly2));

            if (intersections != null && intersections.Count() > 0)
            {
                foreach (IPoint point in intersections)
                {
                    yield return(point);
                }
            }
        }
        public static IEnumerable <IPoint> Execute(IEnumerable <IPoint> line, IPolygon poly)
        {
            IPoint    previous    = null;
            IGeometry polygonLine = PolygonToLine.Execute(poly);

            foreach (IPoint point in line)
            {
                if (PointInPolygon.Execute(point, poly))
                {
                    yield return(point);
                }
                if (previous != null)
                {
                    IEnumerable <IPoint> intersections = LineIntersect.Execute(LineString.Create(previous, point), polygonLine);
                    if (intersections != null)
                    {
                        foreach (IPoint intersection in intersections)
                        {
                            yield return(intersection);
                        }
                    }
                }

                previous = point;
            }
        }
        public static bool ExecuteBoolean(IEnumerable <IPoint> line, IPolygon poly)
        {
            foreach (IPoint point in line)
            {
                if (PointInPolygon.Execute(point, poly))
                {
                    return(true);
                }
            }
            IEnumerable <IPoint> intersections = LineIntersect.Execute(LineString.Create(line.ToArray()), PolygonToLine.Execute(poly));

            if (intersections != null && intersections.Count() > 0)
            {
                return(true);
            }
            return(false);
        }