Learn R Programming

reproducible (version 1.1.1)

.getTargetCRS: Hierarchically get crs from Raster*, Spatial*

Description

This is the function that follows the table of order of preference for determining CRS. See postProcess

Usage

.getTargetCRS(useSAcrs, studyArea, rasterToMatch, targetCRS = NULL)

Arguments

useSAcrs

Logical. If FALSE, the default, then the desired projection will be taken from rasterToMatch or none at all. If TRUE, it will be taken from studyArea. See table in details below.

studyArea

SpatialPolygons* object used for masking and possibly cropping if no rasterToMatch is provided. If not in same CRS, then it will be spTransformed to CRS of x before masking. Currently, this function will not reproject the x. Optional in postProcess.

rasterToMatch

Template Raster* object used for cropping (so extent should be the extent of desired outcome) and reprojecting (including changing the resolution and projection). See details in postProcess.