reproject | R Documentation |
Converts between coordinates on a compiled raster map (i.e. pixel units) and different Geographic Coordinate Systems (CRS).
reproject(
from,
to,
x = NULL,
y = NULL,
coords = NULL,
model = NULL,
add = FALSE,
input_prefix = "",
output_prefix = "new"
)
from , to |
Either a CRS code accepted by GDAL, a valid integer
EPSG value, an object of class |
x , y |
Coordinates in two dimensions (if missing, coordinates
are expected to be in the |
coords |
data.frame-like object with coordinates in columns "x" and "y" |
model |
Object of the class |
add |
Add column coordinates to the input data.frame
|
input_prefix , output_prefix |
Input and output prefixes of data frame columns with spatial coordinates |
Data.frame with converted two-dimensional coordinates given as input
lon_lat_df <- data.frame(x = c(30, 0, 15), y = c(60, 40, 10))
reproject(
from = "epsg:4326",
to = "epsg:3035",
coords = lon_lat_df,
add = TRUE # add converted [lon,lat] coordinates as a new column
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.