Description Usage Arguments Details Value
View source: R/getNearestPointOnLine.R
Lines are specified as a sp::SpatialLines
object. The points are a
sp::SpatialPoints
object. If there are multiple lines in the lines
object, the nearest point might be wrong so results should be checked.
1 2 3 4 5 6 | getNearestPointOnLine(
l,
p,
smooth.method = c("ksmooth", "none", "gSimplify"),
...
)
|
l |
the lines as a |
p |
the points as a |
smooth.method |
type of method to use to smooth the offshore line. This is needed to have the offshore points spread regularly along the line and not be affected by divots. |
... |
parameters to specify smoothing. If "gSimplify", |
Note, the maptools::snapPointsToLines()
function should do this, but it is
not working with the SpatialLines
object produced by converting a polygon
to lines. It may work fine if one converts the SpatialPolygon
to
a SpatialLinesDataFrame
with the proper line id's.
If the line is wavey, smoothing can help find points that look more perpendicular to the coast.
vector of points
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.