invert_vector {restoptr}R Documentation

Invert a vector layer according to the extent of a restopt problem.

Description

Invert a vector layer according to the extent of a restopt problem.

Usage

invert_vector(vector_layer, extent = NULL, filter = NULL)

Arguments

vector_layer

terra::vect() Vector layer.

extent

SpatExtent Optional: you can specify another extent as the input vector layer extent for the inversion.

filter

Optional: filter to apply to x. Leave NULL for no filtering.

Details

Invert a vector layer according to its extent, or a user-specified extent. This function is useful to derive locked out areas from accessible areas, e.g. buffer around tracks.

Value

A terra::vect() Vector object.

Examples


habitat_data <- rast(
  system.file("extdata", "habitat_hi_res.tif", package = "restoptr")
)
available <- vect(
  system.file("extdata", "accessible_areas.gpkg", package = "restoptr")
)
locked_out <- invert_vector(
  vector_layer = available,
  extent = ext(habitat_data),
  filter = available$ID==2
)



[Package restoptr version 1.0.6 Index]