create_Lines: Create Lines

Description Usage Arguments Value Examples

Description

Create Lines that are compatible with CCAMLR online GIS

Usage

1
2
create_Lines(Input, OutputFormat = "ROBJECT", OutputName = NULL,
  Buffer = 0, Densify = 1, Clip = FALSE)

Arguments

Input

the name of the input data as a .csv file or an R dataframe. If .csv input then ensure this file is in your set work directory in quotes e.g. "DataFile.csv". The columns of the input should be in the following order: Name, Latitude,Longitude

OutputFormat

can be an R object or ESRI Shapefile. R object is specified as "ROBJECT" and returns a SpatialLinesDataFrame to your R work enviornment (if this parameter is not specified this is the default). The ESRI Shapefile output is specified as "SHAPEFILE" will write an ESRI Shapefile to your work directory or set file path.

OutputName

if "SHAPEFILE" format is specified then supply the name of the output shapefile in quotes e.g."MyShape", the default is NULL and assumes an "ROBJECT" format

Buffer

is the value in nautical miles to apply to the line. The default value is 0, assuming no Buffer

Densify

is set to 1 as a default, which will add additional points between points of equal latitude when data are projected. If set to 0 then no additional points will be added

Clip

is TRUE will clip a line that intersect with the coastline to remove the land and keep only the ocean area, the default is set to FLASE which assumes no clipping is required

Value

Returns line(s) in R or output to ESRI shapefile format with Attributes "name" and "LengthKm" and "LengthNm. LengthKm is calculated using the LineLength function in the sp package based on the geometry created in the function. If a buffer is applied then an additional attribute of "AreaKm2" is also returned. This planimetric area value is calculated using the gArea function from the sp package

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## specify the name of the line

Name <- rep("Set_1",2)

## specify the Longitude coordinates in decimal degrees

Lon <- c(-120,-122)

## specify the Latitude coordinates in decimal degrees

Lat<- c(-65,-65)

## bind information together into a dataframe 

Coords<- data.frame(Name=Name,Lat=Lat,Lon=Lon)

## create lines 

New_Lines <- create_Lines(Coords)

lucymerobinson/CCAMLRGIS documentation built on May 14, 2019, 8:59 a.m.