mosaic_epsg | R Documentation |
This function calculates the EPSG code for a given mosaic based on its geographic extent.
mosaic_epsg(mosaic)
mosaic |
A raster object representing the mosaic for which the EPSG code is to be determined. |
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.
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.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.