shift_border {SpatialRDD}R Documentation

Shift, shrink/grow, and rotate borders around

Description

This functions takes in a border and can either shift, shrink, or rotate it. All of them can be done together as well. This usually takes a bit of trial and error, so make sure to plot the result each time. For a detailed walk through check out the according vignette: vignette(shifting_borders).

Usage

shift_border(
  border,
  operation = c("shift", "scale", "rotate"),
  shift = c(0, 0),
  scale = 1,
  angle = 0
)

Arguments

border

sf object with line geometry

operation

"shift", "rotate", "scale" - or a combination of them

shift

if operation = "shift", shift distance in CRS units (if UTM it is metres) for x and y coordinates as c(dist_x, dist_y)

scale

if operation = "scale", provide shrinkage/growth factor: e.g. .9 to shrink by 10perc. and 1.1 to increase by 10perc.

angle

if operation = "rotate", provide angle in degrees

Value

a new border in the form of an sf object

Examples

shift_border(border = cut_off, operation = c("shift", "scale"),
shift = c(-5000, -3000), scale = .85)

shift_border(border = cut_off, operation = "rotate", angle = 10)



[Package SpatialRDD version 0.1.0 Index]