use of com.revolsys.geometry.noding.NodedSegmentString in project com.revolsys.open by revolsys.
the class SimpleSnapRounder method computeSnaps.
/**
* Computes nodes introduced as a result of snapping segments to snap points (hot pixels)
* @param li
*/
private void computeSnaps(final Collection segStrings, final Collection snapPts) {
for (final Iterator i0 = segStrings.iterator(); i0.hasNext(); ) {
final NodedSegmentString ss = (NodedSegmentString) i0.next();
computeSnaps(ss, snapPts);
}
}
use of com.revolsys.geometry.noding.NodedSegmentString in project com.revolsys.open by revolsys.
the class Buffer method computeNodedEdges.
private static void computeNodedEdges(final Noder noder, final EdgeList edges, final List<NodedSegmentString> segments) {
noder.computeNodes(segments);
final Collection<NodedSegmentString> nodedSegments = noder.getNodedSubstrings();
for (final SegmentString segment : nodedSegments) {
final int vertexCount = segment.size();
if (vertexCount > 2 || vertexCount == 2 && !segment.equalsVertex2d(0, 1)) {
final Label oldLabel = (Label) segment.getData();
final Label label = new Label(oldLabel);
final LineString points = segment.getLineString();
final Edge edge = new Edge(points, label);
insertUniqueEdge(edges, edge);
}
}
}
use of com.revolsys.geometry.noding.NodedSegmentString in project com.revolsys.open by revolsys.
the class NodingFunctions method newNodedSegmentStrings.
private static List<NodedSegmentString> newNodedSegmentStrings(final Geometry geom) {
final List<NodedSegmentString> segs = new ArrayList<>();
final List<LineString> lines = geom.getGeometries(LineString.class);
for (final LineString line : lines) {
segs.add(new NodedSegmentString(line, null));
}
return segs;
}
Aggregations