use of com.revolsys.geometry.noding.NodingValidator in project com.revolsys.open by revolsys.
the class GeometryNoder method node.
/**
* Nodes the linework of a set of Geometrys using SnapRounding.
*
* @param geometries a Collection of Geometrys of any type
* @return a List of LineStrings representing the noded linework of the input
*/
public List<LineString> node(final Collection<? extends Geometry> geometries) {
// get geometry factory
final Geometry geom0 = geometries.iterator().next();
this.geomFact = geom0.getGeometryFactory();
final Collection<LineString> lines = extractLines(geometries);
final List<NodedSegmentString> segStrings = toSegmentStrings(lines);
// Noder sr = new SimpleSnapRounder(pm);
final Noder sr = new MCIndexSnapRounder(this.scale);
sr.computeNodes(segStrings);
final Collection<NodedSegmentString> nodedLines = sr.getNodedSubstrings();
// TODO: improve this to check for full snap-rounded correctness
if (this.isValidityChecked) {
final NodingValidator nv = new NodingValidator(nodedLines);
nv.checkValid();
}
return toLineStrings(nodedLines);
}
Aggregations