Exemplo n.º 1
0
        public override bool Intersects(Geometry g)
        {
            // envelope test
            if (!EnvelopesIntersect(g))
            {
                return(false);
            }

            // optimization for rectangles
            if (_isRectangle)
            {
                return(RectangleIntersects.Intersects((Polygon)Geometry, g));
            }

            return(PreparedPolygonIntersects.Intersects(this, g));
        }
        /// <summary>
        /// Computes the intersects predicate between a <see cref="PreparedPolygon"/>
        /// and a <see cref="Geometry"/>.
        /// </summary>
        /// <param name="prep">The prepared polygon</param>
        /// <param name="geom">A test geometry</param>
        /// <returns>true if the polygon intersects the geometry</returns>
        public static bool Intersects(PreparedPolygon prep, Geometry geom)
        {
            var polyInt = new PreparedPolygonIntersects(prep);

            return(polyInt.Intersects(geom));
        }