This project generates a high-resolution terrain map that combines:
- PRISM precipitation normals (
ppt, 800m, 1991-2020) - A sunshine proxy derived from terrain exposure (aspect + slope)
- Hillshade-based relief for topographic texture
The script builds a bivariate (rain vs. sunshine) color map, adds cartographic elements (legend, north arrow, scale bar), and exports a final PNG.
- Reads a boundary polygon (GeoJSON) for the target area.
- Downloads and processes DEM terrain data for that boundary.
- Downloads PRISM precipitation normals and clips to the same extent.
- Normalizes/stretches both rain and sunshine layers.
- Combines them into a bivariate color surface over shaded relief.
- Writes a high-resolution output map to
outputs/.
- Put your boundary file in
data_raw/boundary/(GeoJSON). - Open
sdTerra.Rand set top-level options if needed (area_name, output path, etc.). - Run:
source("sdTerra.R")- Boundary:
data_raw/boundary/*.geojson - Optional labels CSV (if used): columns
name,lon,lat
sfterraelevatrggplot2prism
Install once with:
install.packages(c("sf", "terra", "elevatr", "ggplot2", "prism"))