This is a standalone Shiny app for browsing CCL_layers raster outputs stored in S3. It's intended to make QA/QC easier.
- Lists tiles for a selected
city / aoi / infrastructure / scenario - Lists available
ccl_layers/*.tifrasters under that scenario - Loads and merges the selected raster across tiles
- Displays the raster on an interactive map with pan, zoom, identify, and optional satellite basemap
- Optionally overlays a vector file from an HTTP
geojsonorjsonURL - Shows summary statistics plus a density plot for continuous rasters or a histogram for nominal rasters
- R
- Internet access to the public
wri-cities-tcmbucket
From this folder:
Rscript run_app.RIf you prefer an interactive R session:
source("run_app.R")- Choose a city from the dropdown--the aoi name will auto populate.
- Choose an infrastructure from the dropdown—-the scenario name will auto populate.
- Click 'List available layers'. The Layer dropdown will populate with the raster layers in the ccl_layers tile folders.
- Choose whether the raster should be rendered as continuous or discrete.
- Optionally add a URL pointing to a geojson layer like a boundary.
- Choose the basemap.
- Click 'Load selected layer' to add the layer to the map. It has to load and merge the layer for all tiles, so it takes a minute, but your patience will be rewarded.
- The raster will display in the map, alongside summary statistics and a density plot for continuous rasters and a histogram for discrete raster. You can also click on the map and the pixel value will be displayed in the box at the lower left of the page.
app.R: the Shiny appR/s3_helpers.R: local copies of the helper functions needed forlist_tiles()andload_and_merge().Rprofile: intentionally inert so opening the repo has no side effectsrun_app.R: installs missing packages and launches the app
- The app reads rasters and lists scenario contents directly from the public S3 bucket over HTTPS.
- The map is displayed in leaflet-friendly lon/lat coordinates, but identify queries are still run against the loaded raster values.