Example #1
0
        public override bool Contains(IGeometry g)
        {
            // short-circuit test
            if (!EnvelopeCovers(g))
            {
                return(false);
            }

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

            return(PreparedPolygonContains.Contains(this, g));
        }
Example #2
0
        ///<summary>
        /// Computes the <c>contains</c> spatial relationship 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 contains the geometry</returns>
        public static bool Contains(PreparedPolygon prep, IGeometry geom)
        {
            PreparedPolygonContains polyInt = new PreparedPolygonContains(prep);

            return(polyInt.Contains(geom));
        }