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[] srcPts,
double snapTolerance)
Creates a new snapper using the given points
as source points to be snapped.
|
LineStringSnapper(LineString srcLine,
double snapTolerance)
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[] snapPts)
Snaps the vertices and segments of the source LineString
to the given set of snap vertices.
|
public LineStringSnapper(LineString srcLine, double snapTolerance)
LineString
as source snap points.srcLine - a LineString to snap (may be empty)snapTolerance - the snap tolerance to usepublic LineStringSnapper(Coordinate[] srcPts, double snapTolerance)
srcPts - the points to snapsnapTolerance - the snap tolerance to usepublic void setAllowSnappingToSourceVertices(boolean allowSnappingToSourceVertices)
public Coordinate[] snapTo(Coordinate[] snapPts)
snapPts - the vertices to snap toCopyright © 2024. All rights reserved.