I downloaded a 'Google Map' terrain map using dismo::gmap
. The raster comes with a Mercator projection. I tried to re-project it to UTM but in doing so, all the colors are lost and the raster is not displayed the same way (add scale + coordinates). Could you explain me how to retain the original colors ?
library(dismo)
library(raster)
area <- extent(678815, 709272, 5004393, 5028388)
proj4 <- "+proj=utm +zone=17 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0"
r <- raster()
extent(r) <- area
proj4string(r) <- proj4
gm <- gmap(x = r, type = "terrain", scale = 1)
gm2 <- projectRaster(gm, crs = proj4)
plot(gm)
plot(gm2)