Ejemplo n.º 1
0
 /// <summary> 
 /// Test whether a point lies in the envelopes of both input segments.
 /// A correctly computed intersection point should return <c>true</c>
 /// for this test.
 /// Since this test is for debugging purposes only, no attempt is
 /// made to optimize the envelope test.
 /// </summary>
 /// <param name="intPt"></param>
 /// <returns><c>true</c> if the input point lies within both input segment envelopes.</returns>
 private bool IsInSegmentEnvelopes(ICoordinate intPt)
 {
     IEnvelope env0 = new Envelope(inputLines[0, 0], inputLines[0, 1]);
     IEnvelope env1 = new Envelope(inputLines[1, 0], inputLines[1, 1]);
     return env0.Contains(intPt) && env1.Contains(intPt);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Computes the full extents of the data source as a 
        /// <see cref="IEnvelope"/>.
        /// </summary>
        /// <returns>
        /// An Envelope instance which minimally bounds all the features
        /// available in this data source.
        /// </returns>
        public IEnvelope GetExtents()
        {
            IEnvelope envelope = new Envelope();

            foreach (DataRowView row in Table.DefaultView)
            {
                ICoordinate coordinate = new Coordinate((double) row[XColumn], (double) row[YColumn]);

                if (!envelope.Contains(coordinate))
                {
                    envelope.ExpandToInclude(coordinate);
                }
            }

            return envelope;
        }