Ejemplo n.º 1
0
		} // public override int ComputeOrientation(Coordinate p1, Coordinate p2, Coordinate q) 

		/// <summary>
		/// Tests to see if point p is in the envelope of ring.
		/// </summary>
		/// <param name="p">Point to test.</param>
		/// <param name="ring">Geometry from which to create envelope.</param>
		/// <returns>Returns true if point is in envelope of ring.</returns>
		private bool IsInEnvelope(Coordinate p, Coordinates ring) 
		{
			Envelope envelope = new Envelope();
			for (int i = 0; i < ring.Count; i++) 
			{
				envelope.ExpandToInclude( ring[i] );
			}
			return envelope.Contains( p );		
		} // private bool IsInEnvelope(Coordinate p, Coordinates ring)
Ejemplo n.º 2
0
		/// <summary>
		/// Return a square envelope containing the argument envelope,
		/// whose extent is a power of two and which is based at a power of 2.
		/// </summary>
		/// <param name="itemEnv"></param>
		public void ComputeKey(Envelope itemEnv)
		{
			_level = ComputeQuadLevel(itemEnv);
			_env = new Envelope();
			ComputeKey( _level, itemEnv );
			// MD - would be nice to have a non-iterative form of this algorithm
			while ( !_env.Contains( itemEnv ) ) 
			{
				_level += 1;
				ComputeKey( _level, itemEnv );
			}
		}