points_to_poly: create polygon from series of points

View source: R/points_to_poly.R

points_to_polyR Documentation

create polygon from series of points

Description

create polygon from series of points

Usage

points_to_poly(pts, method = "concave")

Arguments

pts

a matrix of latitute and longitude points, or a data.frame with latitude and longitude as column names

method

a string specifying the shape of the polygon, defaults as 'concave'. Currently 'concave' is the only supported method.

Details

creates a automatically generated footprint from a series of points

Value

a data.frame of latitude and longitude points representing the spatial footprint of the data

Author(s)

Jordan S. Read

Examples

## Not run: 
#'file_nm <- system.file(package='mdextract','ext','data_gbif_1.csv')
example_points <- read.table(file=file_nm,header=T,sep=',')
point_matrix <- matrix(as.numeric(c(example_points$decimalLongitude,example_points$decimalLatitude)),
 nrow=nrow(example_points),ncol=2)
poly <- pointsToPoly(point_matrix,method="concave")
plot(point_matrix)
lines(poly)
## End(Not run)

ropensci/mdextract documentation built on May 18, 2022, 5:37 p.m.