Class StretchedVertexFinder
- java.lang.Object
-
- org.locationtech.jtstest.testbuilder.topostretch.StretchedVertexFinder
-
class StretchedVertexFinder extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static LineSegmentdistSegprivate EnvelopelimitEnvprivate java.util.Collectionlinestringsprivate java.util.ListnearVertsprivate doubletolerance
-
Constructor Summary
Constructors Constructor Description StretchedVertexFinder(java.util.Collection linestrings, double tolerance)StretchedVertexFinder(java.util.Collection linestrings, double tolerance, Envelope limitEnv)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static booleancontains(Envelope env, Coordinate p0, Coordinate p1)private static doubledistanceToSeg(Coordinate p, Coordinate p0, Coordinate p1)static java.util.ListfindNear(java.util.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 voidfindNearVertices()private voidfindNearVertices(LineString targetLine)private static intgeomPointsLen(Coordinate[] pts)java.util.ListgetNearVertices()private static booleanisPointNearButNotOnSeg(Coordinate p, Coordinate p0, Coordinate p1, double distTol)
-
-
-
Field Detail
-
linestrings
private java.util.Collection linestrings
-
tolerance
private double tolerance
-
limitEnv
private Envelope limitEnv
-
nearVerts
private java.util.List nearVerts
-
distSeg
private static LineSegment distSeg
-
-
Constructor Detail
-
StretchedVertexFinder
public StretchedVertexFinder(java.util.Collection linestrings, double tolerance)
-
StretchedVertexFinder
public StretchedVertexFinder(java.util.Collection linestrings, double tolerance, Envelope limitEnv)
-
-
Method Detail
-
findNear
public static java.util.List findNear(java.util.Collection linestrings, double tolerance, Envelope mask)
-
getNearVertices
public java.util.List getNearVertices()
-
findNearVertices
private void findNearVertices()
-
geomPointsLen
private static int geomPointsLen(Coordinate[] pts)
-
findNearVertices
private void findNearVertices(LineString targetLine)
-
findNearVertex
private void findNearVertex(Coordinate[] linePts, int index)
-
findNearVertex
private void findNearVertex(Coordinate[] targetPts, int index, LineString testLine)
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
private static boolean contains(Envelope env, Coordinate p0, Coordinate p1)
-
isPointNearButNotOnSeg
private static boolean isPointNearButNotOnSeg(Coordinate p, Coordinate p0, Coordinate p1, double distTol)
-
distanceToSeg
private static double distanceToSeg(Coordinate p, Coordinate p0, Coordinate p1)
-
-