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 LineSegment
distSeg
private Envelope
limitEnv
private java.util.Collection
linestrings
private java.util.List
nearVerts
private double
tolerance
-
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 boolean
contains(Envelope env, Coordinate p0, Coordinate p1)
private static double
distanceToSeg(Coordinate p, Coordinate p0, Coordinate p1)
static java.util.List
findNear(java.util.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
findNearVertices()
private void
findNearVertices(LineString targetLine)
private static int
geomPointsLen(Coordinate[] pts)
java.util.List
getNearVertices()
private static boolean
isPointNearButNotOnSeg(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)
-
-