powered by
Raster to col, row, value
get_points(landscape_mat, resolution)
matrix with three columns: col, row, value
A matrix object
A vector with two numbers (usually calculated using terra::res)
The col and row values are multiplied by the resolution to get the (internal) coordinates of the points.
landscape <- terra::rast(landscapemetrics::landscape) landscape_mat <- terra::as.matrix(landscape, wide = TRUE) resolution <- terra::res(landscape) get_points(landscape_mat, resolution)
Run the code above in your browser using DataLab