create_Polys: Create Polygons

Description Usage Arguments Value Examples

Description

Create Polygons such as proposed Research Blocks or Marine Protected Areas

Usage

1
2
create_Polys(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 in the input should be in the following order: Poly Name, Lats and Lons

OutputFormat

can be an R object or ESRI Shapefile. R object is specified as "ROBJECT" and returns a SpatialPolygonDataFrame 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 polygon verticies. 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

TRUE will clip a polygon 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 polygon(s) in R or output to ESRI shapefile format with Attributes "name" and "AreaKm2". AreaKm2 is calculated using the gArea function from the sp package based on the geometry created in the function

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 Research block

Name <-"5841_6"

## specify the Longitude coordinates in decimal degrees

Lons <- c(130, 130, 134, 134)

## specify the Latitude coordinates in decimal degrees

Lats <- c(-64.0, -65.5, -65.5,-64.0)

## bind information together into a dataframe 

Coords <- data.frame(Name=rep(Name,length(Lons)),Lats=Lats,Lons=Lons)

## create polygon of proposed Research area

New_RBs <-create_Polys(Coords)

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