SplitSpLines: Split Spatial Lines

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function divides an object of class SpatialLines-class defined by the argument [sp.lines] into a number of sub sets of SpatialLines defined by the argument [into].

Usage

1
2
  # divides the SpatialLines Object into 8 sub sets of SpatialLines
  SplitSpLines(sp.lines, into)

Arguments

sp.lines

Object of class SpatialLines-class calculated by the function Df2SpLines.

into

Number of times that the sp.lines object must be divided.

Details

If the number provided by the argument [into] is not multiple of the number of lines in the SpatialLines object, the last element of the list will contain a SpatialLines object with more lines than the first ones. Thus, the original SpatialLines object will not be equally divided.

Although this function might be used seperately, the SplitSpLines function is called by the RasterizeTraj function in order to split the spLines and hence, do the process in parallel.

Value

Returns a list of SpatialLines Object.

Author(s)

Thalles Santos Silva

See Also

SpatialLines-class, Df2SpLines.

Examples

1
2
3
4
5
6
## split the SpatialLines object in a list with 8 SpatialLines objects

crs <- "+proj=longlat +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0"
air.traj.lines <- Df2SpLines(air.traj, crs)

lines.list <- SplitSpLines(air.traj.lines, 8)

opentraj documentation built on May 1, 2019, 8:47 p.m.