Search in sources :

Example 1 with MaximalEdgeRing

use of com.revolsys.geometry.operation.overlay.MaximalEdgeRing in project com.revolsys.open by revolsys.

the class ConnectedInteriorTester method buildEdgeRings.

/**
 * Form DirectedEdges in graph into Minimal EdgeRings.
 * (Minimal Edgerings must be used, because only they are guaranteed to provide
 * a correct isHole computation)
 */
private List buildEdgeRings(final Collection dirEdges) {
    final List edgeRings = new ArrayList();
    for (final Iterator it = dirEdges.iterator(); it.hasNext(); ) {
        final DirectedEdge de = (DirectedEdge) it.next();
        // if this edge has not yet been processed
        if (de.isInResult() && de.getEdgeRing() == null) {
            final MaximalEdgeRing er = new MaximalEdgeRing(de, this.geometryFactory);
            er.linkDirectedEdgesForMinimalEdgeRings();
            final List minEdgeRings = er.buildMinimalRings();
            edgeRings.addAll(minEdgeRings);
        }
    }
    return edgeRings;
}
Also used : DirectedEdge(com.revolsys.geometry.geomgraph.DirectedEdge) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List) MaximalEdgeRing(com.revolsys.geometry.operation.overlay.MaximalEdgeRing)

Aggregations

DirectedEdge (com.revolsys.geometry.geomgraph.DirectedEdge)1 MaximalEdgeRing (com.revolsys.geometry.operation.overlay.MaximalEdgeRing)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 List (java.util.List)1