예제 #1
0
			public MCSelecter(MCPointInRing nested,Coordinate p)
			{
				_nested = nested;
				this._p = p;
			}
예제 #2
0
 public MCSelecter(MCPointInRing nested, Coordinate p)
 {
     _nested = nested;
     this._p = p;
 }
예제 #3
0
		/// <summary>
		/// Test that each hole is inside the polygon shell.
		/// This routine assumes that the holes have previously been tested
		/// to ensure that all vertices lie on the shell or inside it.
		/// A simple test of a single point in the hole can be used,
		/// provide the point is chosen such that it does not lie on the
		/// boundary of the shell.
		/// </summary>
		/// <param name="p">The polygon to be tested for hole inclusion.</param>
		/// <param name="graph">Graph a GeometryGraph incorporating the polygon.</param>
		private void CheckHolesInShell(Polygon p, GeometryGraph graph)
		{
			LinearRing shell = (LinearRing) p.GetExteriorRing();
			Coordinates shellPts = shell.GetCoordinates();

			//PointInRing pir = new SimplePointInRing(shell);
			//PointInRing pir = new SIRtreePointInRing(shell);
			IPointInRing pir = new MCPointInRing(shell);

			for (int i = 0; i < p.GetNumInteriorRing(); i++) 
			{

				LinearRing hole = (LinearRing) p.GetInteriorRingN(i);
				Coordinate holePt = FindPtNotNode(hole.GetCoordinates(), shell, graph);
				if (holePt == null)
				{
					throw new InvalidOperationException("Unable to find a hole point not a vertex of the shell.");
				}

				bool outside = ! pir.IsInside(holePt);
				if ( outside ) 
				{
					_validErr = new TopologyValidationError(
						TopologyValidationError.HoleOutsideShell,
						holePt);
					return;
				}
			}
		}