tiff_torast {geohabnet}R 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)


[Package geohabnet version 2.1.2 Index]