Skip to contents

This function allows you to re-route demonstrative movement data that has been reconstructed using a movement model around a polygon barrier.

Usage

sub_rrt(track_data, CRS, barrier, vis_graph, buffer)

Arguments

track_data

point location data with latitude and longitude information

CRS

epsg code for desired coordinate system transformation

barrier

polygon or multipolygon sf object

vis_graph

vis_graph object created from pathroutr::prt_vis_graph function

buffer

desired buffer size for re-routed tracks; generally should relate to range of receivers; distance should use the same units as the final coordinate system

Value

A simple feature (multi)polygon object

Examples

library(sporeg)
library(dplyr)
library(pathroutr)
library(sf)
load(system.file("extdata", "subset.Rda", package = "sporeg"))
load(system.file("extdata", "atlcoast.Rda", package = "sporeg"))

CRS <- 3857
barrier <- atlcoast
vis_graph <- pathroutr::prt_visgraph(barrier)
#> Warning: repeating attributes for all sub-geometries for which they may not be constant
buffer <- 650

tbuff650 <- sub_rrt(subset, CRS, barrier, vis_graph, buffer)
#> Warning: x is already of type POLYGON.
#> Warning: repeating attributes for all sub-geometries for which they may not be constant