Check input landscape
Details
This function extracts basic information about the input landscape. It includes a type of coordinate reference system (crs) - either "geographic", "projected", or NA, units of the coordinate reference system, a class of the input landscape's values and the number of classes found in the landscape.
Examples
augusta_nlcd <- terra::rast(landscapemetrics::augusta_nlcd)
check_landscape(augusta_nlcd)
#> layer crs units class n_classes OK
#> 1 1 projected m integer 15 ✔
podlasie_ccilc <- terra::rast(landscapemetrics::podlasie_ccilc)
check_landscape(podlasie_ccilc)
#> Warning: Caution: Coordinate reference system not metric - Units of results based on cellsizes and/or distances may be incorrect.
#> layer crs units class n_classes OK
#> 1 1 geographic degrees integer 14 ✖
landscape <- terra::rast(landscapemetrics::landscape)
check_landscape(c(landscape, landscape))
#> Warning: Caution: Coordinate reference system not metric - Units of results based on cellsizes and/or distances may be incorrect.
#> Warning: Caution: Coordinate reference system not metric - Units of results based on cellsizes and/or distances may be incorrect.
#> layer crs units class n_classes OK
#> 1 1 NA NA integer 3 ❓
#> 2 2 NA NA integer 3 ❓