powered by
This function calculates the coordinates of the nearest point on a line to a given point. This function does not work with geographic coordinates.
nearestPointOnLine(coordsLine, coordsPoint)
Matrix with coordinates of line vertices. Each row represents a vertex.
A vector representing the X and Y coordinates of the point.
Vector with the X and Y coordinates of the nearest point on a line to the given point.
nearestPointOnSegment, snapPointsToLines
nearestPointOnSegment
snapPointsToLines
# NOT RUN { coordsLine = cbind(c(1,2,3),c(3,2,2)) coordsPoint = c(1.2,1.5) nearestPointOnLine(coordsLine, coordsPoint) # }
Run the code above in your browser using DataLab