Add an Area of Interest
The SMORES application calculates map boundaries, area cropping, and grid resolutions dynamically based on the selected Area of Interest (AOI).
Step 1: Update the AOI Dataset
The application pulls the spatial bounds and names for all selectable areas directly from a single master file: ‘AOI_Full.parquet’. You must append your new AOI polygon to this dataset. Reference the areas_of_interest.qmd that lives within the data_processing/. This file has the necessary steps written below mapped out and can be added onto. In general the steps are as follows:
Acquire the Polygon: Load your new AOI shapefile/polygon into R.
Clean Data: Run qa/qc on dataset to ensure geometry is intact and valid.
Standardize the CRS: Ensure the polygon is in the correct spatial reference.
Format the Column Name: Add a column specifically named Area_Name and assign your polygon a display name that will be used by the application (e.g., Brookings or Washington).
Append the Data: add your new polygon to the existing Areas_Of_Interest_Full object.
Save the Parquet: Overwrite the master dataset by executing and saving a new file.
Step 2: Map the Grid Resolution
When a user selects an AOI, the server needs to know which data to use (high-resolution (2km) or regional (5km)).
Open global.R.
Locate the resolution_for_aoi named vector.
Add a new row matching your exact Area_Name to the desired folder resolution (“2km” or “5km”). Resolutions have been selected on a developer basis informed by memory constraints ie. larger spatial areas have larger grid cells applied to lower the memory costs and improve performance of the application.
Save global.R.