load_spatial: Load spatial data and ensure projection matching

View source: R/utils.R

load_spatialR Documentation

Load spatial data and ensure projection matching

Description

load_spatial is a helper function that loads spatial data (vector or raster) and ensures the projection information matches exactly that selected for the overall analysis.

Usage

load_spatial(x, proj.info, vec = FALSE, wd.loc, path.in)

Arguments

x

Character string specifying the file name containing the spatial object.

proj.info

Desired projection string in EPSG code format ("EPSG:XXXX"), common to all spatial objects in the analysis.

vec

Logical indicator of whether the spatial data to be loaded is in vector format (TRUE) or raster data (FALSE; default).

wd.loc

Character string identifying the base directory containing both input and output data folders.

path.in

Character string identifying the relative path from the base directory (wd.loc) to where input data are stored. Defaults to an Input_Data folder within the base folder.

Value

A Raster* or Spatial* object, projected to the desired project-wide projection.


tfullman/dia documentation built on Oct. 17, 2023, 6:31 p.m.