Class StretchedVertexFinder
java.lang.Object
org.locationtech.jtstest.testbuilder.topostretch.StretchedVertexFinder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static LineSegment
private Envelope
private Collection
private List
private double
-
Constructor Summary
ConstructorsConstructorDescriptionStretchedVertexFinder
(Collection linestrings, double tolerance) StretchedVertexFinder
(Collection linestrings, double tolerance, Envelope limitEnv) -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
contains
(Envelope env, Coordinate p0, Coordinate p1) private static double
distanceToSeg
(Coordinate p, Coordinate p0, Coordinate p1) static List
findNear
(Collection linestrings, double tolerance, Envelope mask) private void
findNearVertex
(Coordinate[] linePts, int index) private void
findNearVertex
(Coordinate[] targetPts, int index, LineString testLine) Finds a single near vertex.private void
private void
findNearVertices
(LineString targetLine) private static int
geomPointsLen
(Coordinate[] pts) private static boolean
isPointNearButNotOnSeg
(Coordinate p, Coordinate p0, Coordinate p1, double distTol)
-
Field Details
-
linestrings
-
tolerance
private double tolerance -
limitEnv
-
nearVerts
-
distSeg
-
-
Constructor Details
-
StretchedVertexFinder
-
StretchedVertexFinder
-
-
Method Details
-
findNear
-
getNearVertices
-
findNearVertices
private void findNearVertices() -
geomPointsLen
-
findNearVertices
-
findNearVertex
-
findNearVertex
Finds a single near vertex. This is simply the first one found, not necessarily the nearest. This choice may sub-optimal, resulting in odd result geometry. It's not clear that this can be done better, however. If there are several near points, the stretched geometry is likely to be distorted anyway.- Parameters:
targetPts
-index
-testLine
-
-
contains
-
isPointNearButNotOnSeg
private static boolean isPointNearButNotOnSeg(Coordinate p, Coordinate p0, Coordinate p1, double distTol) -
distanceToSeg
-