upload_land: Import and convert a shapefile to an object of class...

Description Usage Arguments Value Author(s) Examples

View source: R/upload_land.R

Description

Import and convert a shapefile to an object of class "lconnect". Some landscape and patch metrics which are the core of landscape connectivity metrics are calculated. The shapefile must be projected, i.e., in planar coordinates and the first field must contain the habitat categories.

Usage

1
upload_land(land_path, bound_path = NULL, habitat, max_dist = NULL)

Arguments

land_path

String indicating the full path of the landscape shapefile.

bound_path

String indicating the full path of the boundary shapefile. If NULL (default option) a convex hull will be created and used as boundary.

habitat

Vector with habitat categories. The categories can be numeric or character.

max_dist

Numeric indicating the maximum distance between patches in the same cluster.

Value

An object of class "lconnect". This object is a list with the following values:

landscape

Spatial polygon object of class "sf" (package "sf") with cluster membership of each polygon.

max_dist

Numeric indicating the maximum distance between patches of the same cluster.

clusters

Numeric vector indicating cluster identity of each polygon.

distance

Object of class "dist" (package "stats") with eucledian distances between all pairs of polygons.

boundary

Spatial polygon of class "sfc" (package "sf") representing the boundary of the landscape.

area_l

Numeric with the total area of the boundary, in square units of landscape units.

Author(s)

Bruno Silva

Frederico Mestre

Examples

1
2
3
4
5
vec_path <- system.file("extdata/vec_projected.shp", 
package = "lconnect")
landscape <- upload_land(vec_path, bound_path = NULL,
habitat = 1, max_dist = 500)
plot(landscape)

lconnect documentation built on Feb. 6, 2021, 5:05 p.m.