Skip to content

kdmonroe/shiny-scape

Repository files navigation

Shiny Scape

Interactive R Shiny app for generating 3D terrain visualizations using rayshader.

Features

  • Preset locations across Pennsylvania, California, and Washington
  • Custom area drawing with validation (max 50 km²)
  • Customizable rendering (vertical exaggeration, color palette, lighting)
  • Smart water detection (auto-disabled for flat terrain)
  • Water feature overlays
  • Minimap showing selected region
  • Interactive 3D controls (rotate, zoom, pan)
  • Loading overlay

Quick Start

Prerequisites

  • R 4.1.0+
  • XQuartz (macOS): xquartz.org - restart after install

Install

# Install packages
install.packages(c("shiny", "leaflet", "leaflet.extras", "sf",
                   "elevatr", "terra", "rayshader", "rgl",
                   "osmdata", "ggplot2", "plotly", "ggspatial", "remotes"))

Run

shiny::runApp()

Usage

  1. Select a location from the dropdown
  2. Adjust parameters (vertical exaggeration, color palette, sun angle, detail level)
  3. Click Generate 3D View
  4. Rotate and zoom the interactive 3D model

Supported Regions

  • Pennsylvania: Wissahickon Valley, Manayunk, Fairmount Park, and more
  • California: Yosemite Valley, Point Reyes, Big Sur, Lake Tahoe
  • Washington: Mount Rainier, Olympic Peninsula, Columbia River Gorge
  • Custom: Draw any rectangle on the map (continental US)

Docker

docker build -t shiny-scape .
docker run -p 3838:3838 -e PORT=3838 shiny-scape
# Visit http://localhost:3838

Adding New Locations

Edit R/map_utils.R and add to get_preset_locations():

your_location = list(
  name = "Location Name",
  lng1 = -75.180, lng2 = -75.150,
  lat1 = 39.940, lat2 = 39.960,
  description = "Brief description"
)

Credits

  • rayshader - Tyler Morgan-Wall
  • elevatr - Jeff Hollister
  • Elevation: AWS Terrain Tiles / USGS

License

MIT

About

3D scapes in a Shiny app. Using Rayshader and R.

Topics

Resources

License

Stars

Watchers

Forks

Contributors