tiff_torast: Get raster object from tif file

View source: R/get_rasters.R

tiff_torastR Documentation

Get raster object from tif file

Description

This is a wrapper of terra::rast() and generates a raster object if provided with a TIF file.

Usage

tiff_torast(path_to_tif)

Arguments

path_to_tif

TIFF file. This is an encoding of map in raster format.

Value

SpatRaster.

Examples


# Generate raster for usage
fp <- paste(tempfile(), ".tif", sep = "")
ret <- utils::download.file(
"https://geohabnet.s3.us-east-2.amazonaws.com/util-rasters/avocado_HarvestedAreaFraction.tif",
destfile = fp, method = "auto", mode = "wb")
tiff_torast(fp)


geohabnet documentation built on June 27, 2024, 5:11 p.m.