You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Download information about facilities with an NPDES permit
We can look up plants by permit id, bounding box, and numerous other
parameters. I plan on providing documentation of available parameters.
However, arguments can be looked up here:
get_cwa_rest_services_get_facility_info
The ECHO database can provide over 270 different columns. echor returns
a subset of these columns that should work for most users. However, you
can specify what data you want returned. Use echoWaterGetMeta() to
return a dataframe with column numbers, names, and descriptions to
identify the columns you want returned. Then include the column numbers
as a comma separated string in the qcolumns argument. In the example
below, the qcolumns argument indicates the dataframe will include
plant name, 8-digit HUC, latitude, longitude, and total design flow.
# A tibble: 4 x 6
#> CWPName SourceID FacStdCountyName CWPNAICSCodes FacLat FacLong
#>
#> 1 CARTERS CREEK WWTP TX0047163 BRAZOS COUNTY 30.6 -96.3
#> 2 CENTRAL UTILITY PLANT TX0002747 BRAZOS COUNTY 30.6 -96.3
#> 3 HEAT TRANSFER RESEARCH TX0106526 BRAZOS COUNTY 30.6 -96.4
#> 4 TURKEY CREEK WWTP TX0062472 BRAZOS COUNTY 30.6 -96.4">df <- echoWaterGetFacilityInfo(output = "df", p_c1lon = '-96.387509', p_c1lat = '30.583572', p_c2lon = '-96.281422', p_c2lat = '30.640008', qcolumns = '1,14,23,24,25', p_ptype = "NPD") head(df) #> # A tibble: 4 x 6 #> CWPName SourceID FacStdCountyName CWPNAICSCodes FacLat FacLong #> #> 1 CARTERS CREEK WWTP TX0047163 BRAZOS COUNTY 30.6 -96.3 #> 2 CENTRAL UTILITY PLANT TX0002747 BRAZOS COUNTY 30.6 -96.3 #> 3 HEAT TRANSFER RESEARCH TX0106526 BRAZOS COUNTY 30.6 -96.4 #> 4 TURKEY CREEK WWTP TX0062472 BRAZOS COUNTY 30.6 -96.4
When returned as sf dataframes, the data is suitable for immediate
spatial plotting or analysis.
Use echoGetEffluent() or echoGetCAAPR() to download tidy dataframes
of permitted water discharger Discharge Monitoring Report (DMR) or
permitted emitters Clean Air Act annual emissions reports. Please note
that all variables are returned as character vectors.
ggplot(df) + geom_line(aes(monitoring_period_end_date, dmr_value_nmbr)) + theme_mps_noto() + labs(x = "Monitoring period date", y = "Dissolved oxygen concentration (mg/l)", title = "Reported minimum dissolved oxygen concentration", subtitle = "NPDES ID = TX119407", caption = "Source: EPA ECHO")
Session Info
sessioninfo::platform_info() #> setting value #> version R version 4.4.0 (2024-04-24) #> os Ubuntu 22.04.4 LTS #> system x86_64, linux-gnu #> ui X11 #> language (EN) #> collate C.UTF-8 #> ctype C.UTF-8 #> tz UTC #> date 2024-05-15 #> pandoc 3.1.11 @ /opt/hostedtoolcache/pandoc/3.1.11/x64/ (via rmarkdown)