Class LengthIndexOfPoint


  • class LengthIndexOfPoint
    extends java.lang.Object
    Computes the length index of the point on a linear Geometry nearest a given Coordinate. The nearest point is not necessarily unique; this class always computes the nearest point closest to the start of the geometry.
    • Field Detail

      • linearGeom

        private Geometry linearGeom
    • Constructor Detail

      • LengthIndexOfPoint

        public LengthIndexOfPoint​(Geometry linearGeom)
    • Method Detail

      • indexOfAfter

        public static double indexOfAfter​(Geometry linearGeom,
                                          Coordinate inputPt,
                                          double minIndex)
      • indexOf

        public double indexOf​(Coordinate inputPt)
        Find the nearest location along a linear Geometry to a given point.
        Parameters:
        inputPt - the coordinate to locate
        Returns:
        the location of the nearest point
      • indexOfAfter

        public double indexOfAfter​(Coordinate inputPt,
                                   double minIndex)
        Finds the nearest index along the linear Geometry to a given Coordinate after the specified minimum index. If possible the location returned will be strictly greater than the minLocation. If this is not possible, the value returned will equal minLocation. (An example where this is not possible is when minLocation = [end of line] ).
        Parameters:
        inputPt - the coordinate to locate
        minIndex - the minimum location for the point location
        Returns:
        the location of the nearest point
      • indexOfFromStart

        private double indexOfFromStart​(Coordinate inputPt,
                                        double minIndex)
      • segmentNearestMeasure

        private double segmentNearestMeasure​(LineSegment seg,
                                             Coordinate inputPt,
                                             double segmentStartMeasure)