HARPgroup / HARParchive

This repo houses HARP code development items, resources, and intermediate work products.
1 stars 0 forks source link

fn_mapgen: Mapping Sources/Facilities and River Segments #1240

Open glenncampagna opened 2 months ago

glenncampagna commented 2 months ago

Documentation for fn_mapgen: the mapping function originally created for Regional Summaries:

Script https://github.com/HARPgroup/HARParchive/blob/master/HARP-2023-Summer/Mapping/Functions/fn_mapgen.R

Function

fn_mapgen <- function(mapnum, featr_type, origin_type, style, metric, origin, bbox, segs, counties, roads,
                       nhd, maplabs, mp_layer, metric_unit, maptitle)

mapnum: either 1 for mapping only facilities/sources or 2 for also mapping river segment metrics featr_type: either source or facility origin_type: basin, locality, or region style: the map style desired (ex: "custom") metric: currently not used in the script, point size and segment fill s based on bins origin: corresponds to origin_type, either a riverseg ID ("PL3_5360_5250"), locality name ("Culpeper") , or region name ("Roanoake_1") bbox: bounding box of class bbox segs: dataframe of river segments to be mapped including a column containing geometry counties: dataframe of county information to be mapped (name, border geometry) roads: a dataframe containing road data including type and geometry nhd: an object of class list containing nhd data retrieved for the bounding box bbox with plot_nhdplus(bbox = bbox, actually_plot = FALSE) maplabs: an object of class list containing map labels created with fn_labelprep mp_layer: a dataframe containing metrics and location for sources/facilities to be mapped metric_unit: the units for the metric being mapped (cfs, mgd, etc) maptitle: character title for the map

Example

fn_mapgen(mapnum = 2, featr_type = "facility", origin_type = "basin",
                   style = styles[[map_style]], metric = "WA_mgd_30_apx", origin = caseStudiesMetrics_df$riverseg[i],
                   bbox = bbox, segs = rsegs_df, counties = counties, roads = roads, nhd = nhd, maplabs = maplabs, 
                   mp_layer = mp_layer, metric_unit = "mgd", maptitle = "WA for L30")

Packages

Functions