Class SimpleSnapRounder
- java.lang.Object
-
- org.locationtech.jts.noding.snapround.SimpleSnapRounder
-
- All Implemented Interfaces:
Noder
public class SimpleSnapRounder extends java.lang.Object implements Noder
Uses Snap Rounding to compute a rounded, fully noded arrangement from a set ofSegmentString
s. Implements the Snap Rounding technique described in the papers by Hobby, Guibas & Marimont, and Goodrich et al. Snap Rounding assumes that all vertices lie on a uniform grid; hence the precision model of the input must be fixed precision, and all the input vertices must be rounded to that precision.This implementation uses simple iteration over the line segments. This is not the most efficient approach for large sets of segments.
This implementation appears to be fully robust using an integer precision model. It will function with non-integer precision models, but the results are not 100% guaranteed to be correctly noded.
- Version:
- 1.7
-
-
Constructor Summary
Constructors Constructor Description SimpleSnapRounder(PrecisionModel pm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
computeNodes(java.util.Collection inputSegmentStrings)
Computes the noding for a collection ofSegmentString
s.void
computeVertexSnaps(java.util.Collection edges)
Computes nodes introduced as a result of snapping segments to vertices of other segmentsjava.util.Collection
getNodedSubstrings()
Returns aCollection
of fully nodedSegmentString
s.
-
-
-
Constructor Detail
-
SimpleSnapRounder
public SimpleSnapRounder(PrecisionModel pm)
-
-
Method Detail
-
getNodedSubstrings
public java.util.Collection getNodedSubstrings()
Description copied from interface:Noder
Returns aCollection
of fully nodedSegmentString
s. The SegmentStrings have the same context as their parent.- Specified by:
getNodedSubstrings
in interfaceNoder
- Returns:
- a Collection of NodedSegmentStrings representing the substrings
-
computeNodes
public void computeNodes(java.util.Collection inputSegmentStrings)
Description copied from interface:Noder
Computes the noding for a collection ofSegmentString
s. Some Noders may add all these nodes to the input SegmentStrings; others may only add some or none at all.- Specified by:
computeNodes
in interfaceNoder
- Parameters:
inputSegmentStrings
- a Collection of NodedSegmentStrings
-
computeVertexSnaps
public void computeVertexSnaps(java.util.Collection edges)
Computes nodes introduced as a result of snapping segments to vertices of other segments- Parameters:
edges
- the list of segment strings to snap together
-
-