Skip to contents

This function rotates the features of an input spatial object by the specified rotation angle and rotation base.

Usage

rotate_features(input_sf, rotation_angle = NULL, rotation_base = "center")

Arguments

input_sf

The input spatial object to be rotated. It can be an 'sf' object or a 'Spatial' object.

rotation_angle

The angle of rotation in degrees.

rotation_base

The rotation base. It can be "center" or a coordinate specifying the rotation base.

Value

A list containing the rotation base and the rotated features as an 'sf' object.

Examples

# Load sample data
data(landcover)

# Rotate the landcover data by 45 degrees around the center

rot_coords <- rotate_features(input_sf = landcover, rotation_angle = 45, rotation_base = "center")