/** * Use a GeometryGraph to node the created edges, * and create split edges between the nodes */ private ArrayList NodeEdges(ArrayList edges) { // intersect edges again to ensure they are noded correctly GeometryGraph graph = new GeometryGraph(0, _geomFact.PrecisionModel, 0); //for (Iterator i = edges.iterator(); i.hasNext(); ) foreach(object obj in edges) { Edge e = (Edge) obj; graph.AddEdge(e); } SegmentIntersector si = graph.ComputeSelfNodes(_li); /* if (si.hasProperIntersection()) Debug.println("proper intersection found"); else Debug.println("no proper intersection found"); */ ArrayList newEdges = new ArrayList(); graph.ComputeSplitEdges(newEdges); return newEdges; }
} // public bool IsSimple( MultiPoint mp ) /// <summary> /// Tests to see if geometry is simple. /// </summary> /// <param name="geom">Geometry to test.</param> /// <returns>Returns true if geometry is simple, false otherwise.</returns> private bool IsSimpleLinearGeometry( Geometry geom ) { if( geom.IsEmpty() ) { return true; } GeometryGraph graph = new GeometryGraph( 0, geom ); LineIntersector li = new RobustLineIntersector(); SegmentIntersector si = graph.ComputeSelfNodes( li ); // if no self-intersection, must be simple if( !si.HasIntersection ) { return true; } if( si.HasProperIntersection ) { return false; } if( HasNonEndpointIntersection( graph ) ) { return false; } if( HasClosedEndpointIntersection( graph ) ) { return false; } return true; } // private bool IsSimpleLinearGeometry( Geometry geom )