Class StretchedVertexFinder

java.lang.Object
org.locationtech.jtstest.testbuilder.topostretch.StretchedVertexFinder

class StretchedVertexFinder extends Object
  • Field Details

    • linestrings

      private Collection linestrings
    • tolerance

      private double tolerance
    • limitEnv

      private Envelope limitEnv
    • nearVerts

      private List nearVerts
    • distSeg

      private static LineSegment distSeg
  • Constructor Details

    • StretchedVertexFinder

      public StretchedVertexFinder(Collection linestrings, double tolerance)
    • StretchedVertexFinder

      public StretchedVertexFinder(Collection linestrings, double tolerance, Envelope limitEnv)
  • Method Details

    • findNear

      public static List findNear(Collection linestrings, double tolerance, Envelope mask)
    • getNearVertices

      public 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)