For a set of points, obtains the closest Line object in a
SpatialLinesDataFrame. The function assumes that each Feature (entry
in the DataFrame part of the SpatialLinesDataFrame) just contains one
Line (i.e. one polyline). The within-polyine chainage (that is,
distance from the initial point of the poyline to the mapping of the
point into the polyline) is also returned. If mask is NULL, each point
in the set is assigned a line in SLDF by Euclidean distance. If mask
is provided, the match between mask and the SLmsk
field in SLDF is used instead for polyline assignation.
pointsSLDFchain(SLDF, xy, SLmsk='FEAT_ID', mask=NULL, type='SpatialPointsDataFrame')A data.frame with two columns, 'chai', and 'eIDs', where 'eIDs' are the row names of the data.frame component of the input SpatialLinesDataFrame
SpatialLinesDataFrame
REAL [n,2] matrix of points, or a SpatialPointsDataFrame
is !is.null(mask) this is the field in the SLDF data.frame matching the values in mask
REAL, OPT, [n] a vector indicating to which line in SLDF is related each point
character. Either 'SpatialPointsDataFrame' or 'mapping'. In the latter case, just the chainage in line feature identifiers are returned
Javier Garcia-Pintado, e-mail: jgarciapintado@marum.de