Search in sources :

Example 1 with EdgeSetIntersector

use of com.revolsys.geometry.geomgraph.index.EdgeSetIntersector in project com.revolsys.open by revolsys.

the class GeometryGraph method computeEdgeIntersections.

public SegmentIntersector computeEdgeIntersections(final GeometryGraph g, final LineIntersector li, final boolean includeProper) {
    final SegmentIntersector si = new SegmentIntersector(li, includeProper, true);
    si.setBoundaryNodes(getBoundaryNodes(), g.getBoundaryNodes());
    final EdgeSetIntersector esi = newEdgeSetIntersector();
    esi.computeIntersections(this.edges, g.edges, si);
    /*
     * for (Iterator i = g.edges.iterator(); i.hasNext();) { Edge e = (Edge) i.next();
     * Debug.print(e.getEdgeIntersectionList()); }
     */
    return si;
}
Also used : SegmentIntersector(com.revolsys.geometry.geomgraph.index.SegmentIntersector) EdgeSetIntersector(com.revolsys.geometry.geomgraph.index.EdgeSetIntersector)

Example 2 with EdgeSetIntersector

use of com.revolsys.geometry.geomgraph.index.EdgeSetIntersector in project com.revolsys.open by revolsys.

the class GeometryGraph method computeSelfNodes.

/**
 * Compute self-nodes, taking advantage of the Geometry type to
 * minimize the number of intersection tests.  (E.g. rings are
 * not tested for self-intersection, since they are assumed to be valid).
 * @param li the LineIntersector to use
 * @param computeRingSelfNodes if <false>, intersection checks are optimized to not test rings for self-intersection
 * @return the SegmentIntersector used, containing information about the intersections found
 */
public SegmentIntersector computeSelfNodes(final LineIntersector li, final boolean computeRingSelfNodes) {
    final SegmentIntersector si = new SegmentIntersector(li, true, false);
    final EdgeSetIntersector esi = newEdgeSetIntersector();
    // optimized test for Polygons and Rings
    if (!computeRingSelfNodes && (this.geometry instanceof LinearRing || this.geometry instanceof Polygonal)) {
        esi.computeIntersections(this.edges, si, false);
    } else {
        esi.computeIntersections(this.edges, si, true);
    }
    // System.out.println("SegmentIntersector # tests = " + si.numTests);
    addSelfIntersectionNodes(this.argIndex);
    return si;
}
Also used : Polygonal(com.revolsys.geometry.model.Polygonal) SegmentIntersector(com.revolsys.geometry.geomgraph.index.SegmentIntersector) EdgeSetIntersector(com.revolsys.geometry.geomgraph.index.EdgeSetIntersector) LinearRing(com.revolsys.geometry.model.LinearRing)

Example 3 with EdgeSetIntersector

use of com.revolsys.geometry.geomgraph.index.EdgeSetIntersector in project com.revolsys.open by revolsys.

the class EdgeSetNoder method getNodedEdges.

public List getNodedEdges() {
    final EdgeSetIntersector esi = new SimpleMCSweepLineIntersector();
    final SegmentIntersector si = new SegmentIntersector(this.li, true, false);
    esi.computeIntersections(this.inputEdges, si, true);
    // Debug.println("has proper int = " + si.hasProperIntersection());
    final List splitEdges = new ArrayList();
    for (final Iterator i = this.inputEdges.iterator(); i.hasNext(); ) {
        final Edge e = (Edge) i.next();
        e.getEdgeIntersectionList().addSplitEdges(splitEdges);
    }
    return splitEdges;
}
Also used : SimpleMCSweepLineIntersector(com.revolsys.geometry.geomgraph.index.SimpleMCSweepLineIntersector) SegmentIntersector(com.revolsys.geometry.geomgraph.index.SegmentIntersector) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) EdgeSetIntersector(com.revolsys.geometry.geomgraph.index.EdgeSetIntersector) List(java.util.List) ArrayList(java.util.ArrayList) Edge(com.revolsys.geometry.geomgraph.Edge)

Aggregations

EdgeSetIntersector (com.revolsys.geometry.geomgraph.index.EdgeSetIntersector)3 SegmentIntersector (com.revolsys.geometry.geomgraph.index.SegmentIntersector)3 Edge (com.revolsys.geometry.geomgraph.Edge)1 SimpleMCSweepLineIntersector (com.revolsys.geometry.geomgraph.index.SimpleMCSweepLineIntersector)1 LinearRing (com.revolsys.geometry.model.LinearRing)1 Polygonal (com.revolsys.geometry.model.Polygonal)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 List (java.util.List)1