# NOT RUN {
#Add the included `sf` object with roads to the montereybay dataset
#Only run these examples if the `magick` package is installed.
if (length(find.package("magick", quiet = TRUE)) > 0) {
# }
# NOT RUN {
water_palette = colorRampPalette(c("darkblue", "dodgerblue", "lightblue"))(200)
bathy_hs = height_shade(montereybay, texture = water_palette)
montereybay %>%
height_shade() %>%
add_overlay(generate_altitude_overlay(bathy_hs, montereybay, 0, 0)) %>%
add_overlay(generate_line_overlay(monterey_roads_sf,
attr(montereybay,"extent"), heightmap = montereybay)) %>%
add_shadow(ray_shade(montereybay,zscale=50),0.3) %>%
plot_map()
#Change the line width, color, and transparency
montereybay %>%
height_shade() %>%
add_overlay(generate_altitude_overlay(bathy_hs, montereybay, 0, 0)) %>%
add_overlay(generate_line_overlay(monterey_roads_sf, linewidth=3, color="white",
attr(montereybay,"extent"), heightmap = montereybay),
alphalayer=0.8) %>%
add_shadow(ray_shade(montereybay,zscale=50),0.3) %>%
plot_map()
#Manually specify the width and height to improve visual quality of the lines
montereybay %>%
height_shade() %>%
add_overlay(generate_altitude_overlay(bathy_hs, montereybay, 0, 0)) %>%
add_shadow(ray_shade(montereybay,zscale=50),0.3) %>%
add_overlay(generate_line_overlay(monterey_roads_sf, linewidth=3, color="white",
attr(montereybay,"extent"), width = 1080, height = 1080),
alphalayer=0.8) %>%
plot_map()
# }
# NOT RUN {
}
# }
Run the code above in your browser using DataLab