create_Lines {CCAMLRGIS}R Documentation

Create Lines

Description

Create lines to display, for example, fishing line locations or tagging data.

Usage

create_Lines(
  Input,
  NamesIn = NULL,
  Buffer = 0,
  Densify = FALSE,
  Clip = FALSE,
  SeparateBuf = TRUE
)

Arguments

Input

input dataframe.

If NamesIn is not provided, the columns in the Input must be in the following order:

Line name, Latitude, Longitude.

If a given line is made of more than two points, the locations of points must be given in order, from one end of the line to the other.

NamesIn

character vector of length 3 specifying the column names of line identifier, Latitude and Longitude fields in the Input.

Names must be given in that order, e.g.:

NamesIn=c('Line ID','Line Latitudes','Line Longitudes').

Buffer

numeric, distance in nautical miles by which to expand the lines. Can be specified for each line (as a numeric vector).

Densify

logical, if set to TRUE, additional points between extremities of lines spanning more than 0.1 degree longitude are added at every 0.1 degree of longitude prior to projection (see examples).

Clip

logical, if set to TRUE, polygon parts (from buffered lines) that fall on land are removed (see Clip2Coast).

SeparateBuf

logical, if set to FALSE when adding a Buffer, all spatial objects are merged, resulting in a single spatial object.

Value

Spatial object in your environment. Data within the resulting spatial object contains the data provided in the Input plus additional "LengthKm" and "LengthNm" columns which corresponds to the lines lengths, in kilometers and nautical miles respectively. If additional data was included in the Input, any numerical values are summarized for each line (min, max, mean, median, sum, count and sd).

To see the data contained in your spatial object, type: View(MyLines).

See Also

create_Points, create_Polys, create_PolyGrids, create_Stations, create_Pies, add_Legend.

Examples



# For more examples, see:
# https://github.com/ccamlr/CCAMLRGIS#create-lines

#Densified lines (note the curvature of the lines)

MyLines=create_Lines(Input=LineData,Densify=TRUE)
plot(st_geometry(MyLines),lwd=2,col=rainbow(nrow(MyLines)))




[Package CCAMLRGIS version 4.1.1 Index]