/// <summary> /// Tests that no hole is nested inside another hole. /// </summary> /// <remarks> /// This routine assumes that the holes are disjoint. /// To ensure this, holes have previously been tested /// to ensure that: /// <ul> /// <li>they do not partially overlap /// (Checked by CheckRelateConsistency)</li> /// <li>they are not identical /// (Checked by CheckRelateConsistency)</li> /// <li>they do not touch at a vertex /// (Checked by ????)</li> /// </ul> /// </remarks> /// <param name="p"></param> /// <param name="graph"></param> private void CheckHolesNotNested(Polygon p, GeometryGraph graph) { QuadtreeNestedRingTester nestedTester = new QuadtreeNestedRingTester(graph); //SimpleNestedRingTester nestedTester = new SimpleNestedRingTester(_arg[0]); //SweeplineNestedRingTester nestedTester = new SweeplineNestedRingTester(_arg[0]); for (int i = 0; i < p.GetNumInteriorRing(); i++) { LinearRing innerHole = p.GetInteriorRingN(i); nestedTester.Add(innerHole); } bool isNonNested = nestedTester.IsNonNested(); if (!isNonNested) { _validErr = new TopologyValidationError( TopologyValidationError.NestedHoles, nestedTester.GetNestedPoint()); } }
/// <summary> /// Tests that no hole is nested inside another hole. /// </summary> /// <remarks> /// This routine assumes that the holes are disjoint. /// To ensure this, holes have previously been tested /// to ensure that: /// <ul> /// <li>they do not partially overlap /// (Checked by CheckRelateConsistency)</li> /// <li>they are not identical /// (Checked by CheckRelateConsistency)</li> /// <li>they do not touch at a vertex /// (Checked by ????)</li> /// </ul> /// </remarks> /// <param name="p"></param> /// <param name="graph"></param> private void CheckHolesNotNested(Polygon p, GeometryGraph graph) { QuadtreeNestedRingTester nestedTester = new QuadtreeNestedRingTester(graph); //SimpleNestedRingTester nestedTester = new SimpleNestedRingTester(_arg[0]); //SweeplineNestedRingTester nestedTester = new SweeplineNestedRingTester(_arg[0]); for (int i = 0; i < p.GetNumInteriorRing(); i++) { LinearRing innerHole = p.GetInteriorRingN( i ); nestedTester.Add(innerHole); } bool isNonNested = nestedTester.IsNonNested(); if ( ! isNonNested ) { _validErr = new TopologyValidationError( TopologyValidationError.NestedHoles, nestedTester.GetNestedPoint()); } }