コード例 #1
0
        public override bool Intersects(IGeometry g)
        {
            // envelope test
            if (!EnvelopesIntersect(g))
            {
                return(false);
            }

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

            return(PreparedPolygonIntersects.Intersects(this, g));
        }
コード例 #2
0
        ///<summary>
        /// Computes the intersects predicate between a <see cref="PreparedPolygon"/>
        /// and a <see cref="IGeometry"/>.
        ///</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, IGeometry geom)
        {
            var polyInt = new PreparedPolygonIntersects(prep);

            return(polyInt.Intersects(geom));
        }