read_raster_runif: Return the data source 'raster_runif' as a SpatRaster

View source: R/read_raster_runif.R

read_raster_runifR Documentation

Return the data source raster_runif as a SpatRaster

Description

The raster_runif data source covers Flanders and the Brussels Capital Region and has a resolution of 32 meters. The raster cells with non-missing values match the value-cells of the GRTSmaster_habitats data source (see read_GRTSmh) with a small buffer added. Every raster cell has a random value between 0 and 1 according to the uniform distribution. The coordinate reference system is 'BD72 / Belgian Lambert 72' (EPSG-code 31370).

Usage

read_raster_runif(
  file = file.path(locate_n2khab_data(), "10_raw/raster_runif/raster_runif.tif"),
  version = "raster_runif_v1"
)

Arguments

file

The absolute or relative file path of the data source. The default follows the data management advice in the vignette on data storage (run vignette("v020_datastorage")). It uses the first n2khab_data folder that is found when sequentially climbing up 0 to 10 levels in the file system hierarchy, starting from the working directory.

version

Version ID of the data source. Defaults to the latest available version defined by the package.

Details

The raster_runif data source is a GeoTIFF file (available at Zenodo).

The R-code for creating the raster_runif data source can be found in the n2khab-preprocessing repository.

Value

A SpatRaster.

If the package is configured to use the raster package (see n2khab_options()), a RasterLayer is returned instead.

Examples

## Not run: 
# This example supposes that your working directory or a directory up to 10
# levels above has
# the 'n2khab_data' folder AND that the latest version of the
# 'raster_runif' data source is present in the default subdirectory.
# In all other cases, this example won't work but at least you can consider
# what to do.
r <- read_raster_runif()
r

## End(Not run)


inbo/n2khab documentation built on Jan. 15, 2025, 9:36 a.m.