data("volcano2")
filled.contour(volcano2, color.palette = hypso.colors, asp = 1)
title(main = "volcano2 data: filled contour map")
# Geo-tag
# Empty raster
volcano2_raster <- terra::rast(volcano2)
terra::crs(volcano2_raster) <- pull_crs(2193)
terra::ext(volcano2_raster) <- c(1756968, 1757576, 5917000, 5917872)
names(volcano2_raster) <- "volcano2"
library(ggplot2)
ggplot() +
geom_spatraster(data = volcano2_raster) +
scale_fill_hypso_c() +
labs(
title = "volcano2 SpatRaster",
subtitle = "Georeferenced",
fill = "Elevation (m)"
)
Run the code above in your browser using DataLab