mosaic_epsg: Determine EPSG Code for a Mosaic

View source: R/utils_mosaic.R

mosaic_epsgR 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

## Not run: 
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)

## End(Not run)


TiagoOlivoto/pliman documentation built on Sept. 14, 2024, 2:24 a.m.