updateNearestLocationsPointLine method

void updateNearestLocationsPointLine(
  1. Coordinate pt,
  2. FacetSequence facetSeq,
  3. int i,
  4. Coordinate q0,
  5. Coordinate q1,
  6. List<GeometryLocation?>? locs,
)

Implementation

void updateNearestLocationsPointLine(Coordinate pt, FacetSequence facetSeq,
    int i, Coordinate q0, Coordinate q1, List<GeometryLocation?>? locs) {
  if(locs != null) {
    locs[0] = GeometryLocation(geom!, start!, Coordinate.fromCoordinate(pt));
    LineSegment seg = LineSegment.fromCoordinates(q0, q1);
    Coordinate segClosestPoint = seg.closestPoint(pt);
    locs[1] = GeometryLocation(
        facetSeq.geom!, i, Coordinate.fromCoordinate(segClosestPoint));
  }
}