Description Usage Arguments Value Examples
View source: R/UTMConversion.R
This function automatically converts a raster or shapefile from a longlat projection into the corresponding UTM projection.
1 | UTMConversion(user_file)
|
user_file |
Can either be a sp/sf object or a raster file. |
The user_file in UTM projection.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(sp)
library(raster)
library(rgdal)
library(geosphere)
# Create a test polygon within Nigeria
my_extent <- extent(5,7,8,10)
my_poly <- as(my_extent, 'SpatialPolygons')
my_proj <- "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0"
proj4string(my_poly) <- CRS(my_proj)
# Apply the UTM conversion function
my_poly_utm <- UTMConversion(my_poly)
crs(my_poly_utm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.