Project a Mosaic to a New Coordinate Reference System (CRS)
Source:R/utils_mosaic.R
mosaic_project.Rd
This function projects a given mosaic to a specified CRS.
Arguments
- mosaic
A raster object representing the mosaic to be projected.
- y
The target CRS to which the mosaic should be projected. This can be specified in various formats accepted by the
terra::project()
function.- ...
Additional arguments passed to the
terra::project()
function.
Examples
if (interactive() && requireNamespace("EBImage")) {
library(terra)
library(pliman)
# Create a sample mosaic
mosaic <- rast(nrow=10, ncol=10, xmin=-120, xmax=-60, ymin=30, ymax=60)
mosaic
# Define target CRS (EPSG code for WGS 84 / UTM zone 33N)
target_crs <- "EPSG:32633"
# Project the mosaic
projected_mosaic <- mosaic_project(mosaic, "EPSG:32633")
projected_mosaic
}
#> class : SpatRaster
#> dimensions : 16, 11, 1 (nrow, ncol, nlyr)
#> resolution : 525050.3, 525050.3 (x, y)
#> extent : -7882445, -2106891, 7246350, 15647155 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 33N (EPSG:32633)