Df2SpLinesDf: Data Frame to Spatial Lines Data Frame

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

Description

This function converts an object of class SpatialLines-class, calculated by the function Df2SpLines, into an Object of class SpatialLinesDataFrame.

Usage

1
  Df2SpLinesDf(spLines, df, add.distance=F, add.azimuth=F)

Arguments

spLines

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

df

data.frame Object created by the function ProcTraj.

add.distance

Logical: If True, it will calculate and include the distance in meters between the first and last point for every line.

add.azimuth

Logical: If True it will calculate and include the azimuth for every line.

Details

Because the additional information carried by the SpatialLinesDataFrame Object have to be a data frame with same number of lines as the number of lines in the SpatialLines Object, the additional information, which each line of the SpatialLinesDataFrame will have, concerns to the first row of an individual trajectory from the data frame calculated by the function ProcTraj

Value

Returns an object of class SpatialLinesDataFrame.

Author(s)

Thalles Santos Silva

See Also

Df2SpLines, ProcTraj, SpatialLines-class, data.frame.

Examples

1
2
3
4
  crs <- "+proj=longlat +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0"
  air.traj.lines <- Df2SpLines(air.traj, crs)
  air.traj.linesDf <- Df2SpLinesDf(air.traj.lines, air.traj)
  PlotTraj(air.traj.linesDf)

Example output

NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files

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