buildMap: Build a site map of WQP sites or ECHO facilities

View source: R/buildMap.r

buildMapR Documentation

Build a site map of WQP sites or ECHO facilities

Description

Build a map of sample sites, facilities, or both. Map includes sites, beneficial use and assessment unit polygons, and satellite and topo baselayers. This is designed to work with column names as extracted from WQP or AWQMS & ECHO via udwqTools functions readWQP(), readAWQMS() and readECHO_fac(). Map will launch in default browser (or R-Studio's browser if using R-Studio). Site and assessment unit features are searchable by idetifier and name via the search button on the left side of the map. The most recently turned on layer is "on top" of the map. Only features on top will show their pop-up on click.

Usage

buildMap(
  fac,
  sites,
  au_poly,
  bu_poly,
  ss_poly,
  search = c("sites", "aus"),
  plot_polys = TRUE,
  dragging = T,
  ...
)

Arguments

fac

Facility locations queried via readECHO_fac.

sites

Site locations queried via readWQP(type="sites"). May also be a data file with WQP site information merged to it.

au_poly

Optional. Polygon file to be mapped as assessment units. Useful for mapping a subset of specific assessment units. If missing, the default state wide AU polygon is used.

bu_poly

Optional. Polygon file to be mapped as beneficial uses. Useful for mapping a subset of beneficial uses. If missing, the default state wide uses polygon is used.

ss_poly

Optional. Polygon file to be mapped as site specific standards. Useful for mapping a subset of ss polygons. If missing, the default state wide ss polygon is used.

search

Vector of objects to be made searchable. One or both of "sites" and "aus". Defaults to c("sites","aus"). Any other inputs are ignored.

Examples

# Read sites & facility locations
jr_sites=readWQP(type="sites",
	siteid=c("UTAHDWQ_WQX-4994100","UTAHDWQ_WQX-4994120","UTAHDWQ_WQX-4991860",
			 "UTAHDWQ_WQX-4994190","UTAHDWQ_WQX-4994172","UTAHDWQ_WQX-4994090",
			 "UTAHDWQ_WQX-4992890","UTAHDWQ_WQX-4992880","UTAHDWQ_WQX-4992480",
			 "UTAHDWQ_WQX-4992055","UTAHDWQ_WQX-4991940","UTAHDWQ_WQX-4991880"))		 
jr_fac=readECHO_fac(p_pid=c("UT0024392","UT0024384","UT0025852","UT0021725"))
#Build some maps
map1=buildMap(sites=jr_sites, fac=jr_fac) #define new object for use later
map1 #call generated map object to launch in browser
buildMap(sites=jr_sites) #just sites, launch w/o generating map object in workspace
buildMap(fac=jr_fac) #just facilities
buildMap() #Build an empty map w/ just AU, BU, and SS std polys
#html maps can be saved via htmlwidgets package saveWidget(map1, file="your/path/map1.html")

utah-dwq/wqTools documentation built on July 18, 2024, 6:45 a.m.