Class StretchedVertexFinder
java.lang.Object
org.locationtech.jtstest.testbuilder.topostretch.StretchedVertexFinder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static LineSegmentprivate Envelopeprivate Collectionprivate Listprivate double -
Constructor Summary
ConstructorsConstructorDescriptionStretchedVertexFinder(Collection linestrings, double tolerance) StretchedVertexFinder(Collection linestrings, double tolerance, Envelope limitEnv) -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleancontains(Envelope env, Coordinate p0, Coordinate p1) private static doubledistanceToSeg(Coordinate p, Coordinate p0, Coordinate p1) static ListfindNear(Collection linestrings, double tolerance, Envelope mask) private voidfindNearVertex(Coordinate[] linePts, int index) private voidfindNearVertex(Coordinate[] targetPts, int index, LineString testLine) Finds a single near vertex.private voidprivate voidfindNearVertices(LineString targetLine) private static intgeomPointsLen(Coordinate[] pts) private static booleanisPointNearButNotOnSeg(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
-