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;
}
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;
}
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;
}
Aggregations