Skip to contents

This function projects a given mosaic from the lon/lat coordinate system to an EPSG-based CRS determined by the mosaic's extent.

Usage

mosaic_lonlat2epsg(mosaic)

Arguments

mosaic

A raster object representing the mosaic to be projected. The mosaic must be in the lon/lat coordinate system.

Value

A raster object representing the projected mosaic. If the mosaic is not in the lon/lat coordinate system, a warning is issued.

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)

# Project the mosaic to the appropriate UTM zone
mosaic_lonlat2epsg(mosaic)
}
#> class       : SpatRaster 
#> dimensions  : 10, 15, 1  (nrow, ncol, nlyr)
#> resolution  : 398290.6, 398290.6  (x, y)
#> extent      : -2769012, 3205348, 3132995, 7115901  (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 16N (EPSG:32616)