pointsSLDFchain {SpatialGraph}R Documentation

Obtain chainage from sparse points along a SpatialLinesDataFrame

Description

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.

Usage

 pointsSLDFchain(SLDF, xy, SLmsk='FEAT_ID', mask=NULL,  type='SpatialPointsDataFrame')

Arguments

SLDF

SpatialLinesDataFrame

xy

REAL [n,2] matrix of points, or a SpatialPointsDataFrame

SLmsk

is !is.null(mask) this is the field in the SLDF data.frame matching the values in mask

mask

REAL, OPT, [n] a vector indicating to which line in SLDF is related each point

type

character. Either 'SpatialPointsDataFrame' or 'mapping'. In the latter case, just the chainage in line feature identifiers are returned

Value

A data.frame with two columns, 'chai', and 'eIDs', where 'eIDs' are the row names of the data.frame component of the input SpatialLinesDataFrame

Author(s)

Javier Garcia-Pintado, e-mail: jgarciapintado@marum.de


[Package SpatialGraph version 1.0-4 Index]