Class SnappingPointIndex
java.lang.Object
org.locationtech.jts.noding.snap.SnappingPointIndex
An index providing fast creation and lookup of snap points.
- Author:
- mdavis
-
Constructor Summary
ConstructorsConstructorDescriptionSnappingPointIndex(double snapTolerance) Creates a snap point index using a specified distance tolerance. -
Method Summary
Modifier and TypeMethodDescriptiondoublesnap(Coordinate p) Snaps a coordinate to an existing snap point, if it is within the snap tolerance distance.
-
Constructor Details
-
SnappingPointIndex
public SnappingPointIndex(double snapTolerance) Creates a snap point index using a specified distance tolerance.- Parameters:
snapTolerance- points are snapped if within this distance
-
-
Method Details
-
snap
Snaps a coordinate to an existing snap point, if it is within the snap tolerance distance. Otherwise adds the coordinate to the snap point index.- Parameters:
p- the point to snap- Returns:
- the point it snapped to, or the input point
-
getTolerance
public double getTolerance()
-