Examples for 'maptools::nearestPointOnLine'


Get the nearest point on a line to a given point

Aliases: nearestPointOnLine

Keywords: spatial

### ** Examples

coordsLine = cbind(c(1,2,3),c(3,2,2))
coordsPoint = c(1.2,1.5)
nearestPointOnLine(coordsLine, coordsPoint)
   X    Y 
1.85 2.15 

[Package maptools version 1.1-4 Index]