public class LineStringSnapper extends Object
LineString to a set of target snap vertices. A snap distance tolerance is used to control where snapping is performed.
The implementation handles empty geometry and empty snap vertex sets.
| Constructor and Description |
|---|
LineStringSnapper(Coordinate
Creates a new snapper using the given points as source points to be snapped.
|
LineStringSnapper(LineString
Creates a new snapper using the points in the given
LineString as source snap points.
|
| Modifier and Type | Method and Description |
|---|---|
void |
setAllowSnappingToSourceVertices(boolean allowSnappingToSourceVertices)
|
Coordinate |
snapTo(Coordinate
Snaps the vertices and segments of the source LineString to the given set of snap vertices.
|
public LineStringSnapper(LineStringsrcLine, double snapTolerance)
LineString as source snap points.
srcLine - a LineString to snap (may be empty)
snapTolerance - the snap tolerance to use
public LineStringSnapper(Coordinate[] srcPts, double snapTolerance)
srcPts - the points to snap
snapTolerance - the snap tolerance to use
public void setAllowSnappingToSourceVertices(boolean allowSnappingToSourceVertices)
public Coordinate[] snapTo(Coordinate [] snapPts)
snapPts - the vertices to snap to