plot_tiltedmaps isn't showing anything

I am trying to plot 2 raster files but when I am using the plot_tiltedmaps function the plot is empty. I am following the steps in the 2nd tutorial, called More advanced example. Any ideas why is that?

Here is the code:

# install.packages("remotes")
remotes::install_github("marcosci/layer")
    
library(layer)
library(terra)

wd <- "path/"

pop = rast(paste0(wd, "pop.tif"))
agbh = rast(paste0(wd, "agbh.tif"))

pop <- tilt_map(pop, y_tilt = 3, x_shift = 25, y_shift = 50, parallel = TRUE)
agbh <- tilt_map(agbh, y_tilt = 3, x_shift = 50, y_shift = 100, parallel = TRUE)

map_list <- list(pop, agbh)

plot_tiltedmaps(map_list, palette = c("tofino", "rocket"), direction = c(-1, 1))

You can download the data from here.

The solution was to increase a lot the y_shift value in the tilt_map function, like so:

library(layer)
library(terra)

agbh = rast("path/agbh.tif")
pop = rast("path/pop.tif")

tilt_landscape_1 <- tilt_map(agbh, parallel = TRUE)
tilt_landscape_2 <- tilt_map(pop, x_shift = 25, y_shift = 5000, parallel = TRUE)

map_list <- list(tilt_landscape_1, tilt_landscape_2)

plot_tiltedmaps(map_list,
                layer = c("value", "value"),
                palette = c("bilbao", "mako"))

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.