mosaic_epsg {pliman} | R Documentation |
Determine EPSG Code for a Mosaic
Description
This function calculates the EPSG code for a given mosaic based on its geographic extent.
Usage
mosaic_epsg(mosaic)
Arguments
mosaic |
A raster object representing the mosaic for which the EPSG code is to be determined. |
Details
The function calculates the centroid of the mosaic's extent, determines the UTM zone based on the centroid's longitude, and identifies the hemisphere based on the centroid's latitude. The EPSG code is then constructed accordingly.
Value
A character string representing the EPSG code corresponding to the UTM zone and hemisphere of the mosaic's centroid. If the mosaic is not in the lon/lat coordinate system, a warning is issued.
Examples
if (interactive() && requireNamespace("EBImage")) {
library(pliman)
library(terra)
# Create a sample mosaic
mosaic <- rast(nrow=10, ncol=10, xmin=-120, xmax=-60, ymin=30, ymax=60)
# Get the EPSG code for the mosaic
mosaic_epsg(mosaic)
}
[Package pliman version 3.0.0 Index]