26 SoCal Earth
Today we’ll be review some functions and features from a simple dashboard made for SoCal Earth
26.1 SoCal Earth
The Redford Conservancy launched SoCal Earth last month. The Goal of soCal Earth is to be a hub for environmental information and transformation in SoCal.
SoCal Earth aims to put community and climate first in decision making.
I built a couple of simple dashboards for conservation and energy. Today, we’ll look at the code and features from the SoCal Conservation dashboard.
The code is on github in two pieces - a pre-processing script and the app script.
26.2 Features
- SelectizeInput for choosing a jurisdiction
- SliderInput for selecting an accessibility buffer distance
- Three separate tiles (terrain, imagery, minimal grey)
- Four data layers (conserved lands, jurisdictions, biodiversity index, and county boundaries)
- ZoomTo feature
- Calculates percentage of land-conserved in three different ways on-the-fly
- Allows for simple comparisons between places with high and low conservation
26.3 New Functions, packages
st_make_valid()
- fix broken topologyst_intersection()
- a spatial join that is similar tost_filter()
but it clips to the first polygonst_is_valid()
- checks for invalid/valid geospatial shapes - returns boolean TRUE or FALSE for all recordsst_zm()
- removes a z-axis from geospatial shapes for display in only 2Dbslib
- shiny layout packagebsicons
- bootstrap icons packagelwgeom
-sf
helper functions for geospatial manipulation - was originally key forst_make_valid()
which is now part of basesf
actionButton()
- shiny function that instigates an action when the user presses the buttonuiOutput()
- renders HTML objects - the generic ui render functionaddMapPane()
- leaflet function that keeps layers in front-to-back order (i.e., zIndex) no matter which layer has been turned on/off most recently- ’leafletProxy()
- manipulates layers of a leaflet map in
shiny` without re-rendering the whole map value_box()
- bslib template for displaying a dashboard-y box with a valuefitBounds()
- leaflet function for zooming to a rectangular box that indicates the currently selected spatial extent