Summarize nearby National Emissions Inventory point emissions
Source:R/nei.R
get_nei_point_summary.RdSummarizes annual facility-level point emissions within buffer meters of
each s2 cell as tons per year. Each date is mapped by
calendar year to the nearest scheduled triennial National Emissions
Inventory (NEI) cycle
(2016-2018 to 2017 NEI, 2019-2021 to 2020 NEI, 2022-2024 to 2023 NEI).
Dates mapping to an unavailable or
unsupported cycle, including 2025 through 2027 mapping to the not-yet-
available 2026 NEI, return NA_real_.
Usage
get_nei_point_summary(
x,
pollutant_code = c("PM25-PRI", "EC", "OC", "SO4", "NO3", "PMFINE"),
fun = sum,
buffer = 1000,
...
)Arguments
- x
a s2_cell_dates vector (see
?s2cd)- pollutant_code
one of
PM25-PRI,EC,OC,SO4,NO3, orPMFINE- fun
function used to summarize nearby annual emissions
- buffer
distance from s2 cell (in meters) to summarize data
- ...
passed to
stow::stow(). Thepackageandsubdirarguments are fixed by geomarker.
Value
a list of numeric vectors of point-source emissions summaries, one
vector per input location and one value per associated date. Values passed
to fun are in tons per year. Dates mapping to unavailable inventory
cycles return NA_real_.
Details
Facility-summary ZIP files for each requested pollutant are downloaded from the Environmental Protection Agency and read directly on each call. Rows are retained only when the pollutant code, latitude, longitude, and total emissions are complete. Latitude, longitude, and total emissions must also be finite, with latitude between -90 and 90 degrees and longitude between -180 and 180 degrees.
fun receives the numeric vector of annual emissions from facilities within
the buffer and must return one numeric value. With the default sum, a
location with no nearby facilities returns zero.
References
https://www.epa.gov/air-emissions-inventories/national-emissions-inventory-nei
https://www.epa.gov/air-emissions-inventories/what-are-units-nei-emissions-data
Examples
local({
withr::local_envvar(
R_USER_DATA_DIR = fs::path_package("geomarker", "gmrkr--8841"),
R_GEOMARKER_NO_DOWNLOAD = "true"
)
print(get_nei_point_summary(s2cd_example()))
print(get_nei_point_summary(s2cd_example(), "PMFINE", buffer = 1600))
print(get_nei_point_summary(s2cd_example_cincy(5L), "PMFINE", buffer = 10000))
})
#> Using managed local copy: /home/runner/work/_temp/Library/geomarker/gmrkr--8841/R/geomarker/stow/get_nei_point_summary/a0c26be4c991d677--eis_report_38234_2023NEI_facility_summary_21jul2026.zip
#> [[1]]
#> [1] 13.06283
#>
#> [[2]]
#> [1] 0 0
#>
#> Using managed local copy: /home/runner/work/_temp/Library/geomarker/gmrkr--8841/R/geomarker/stow/get_nei_point_summary/a0c26be4c991d677--eis_report_38234_2023NEI_facility_summary_21jul2026.zip
#> [[1]]
#> [1] 4.476152
#>
#> [[2]]
#> [1] 0 0
#>
#> Using managed local copy: /home/runner/work/_temp/Library/geomarker/gmrkr--8841/R/geomarker/stow/get_nei_point_summary/a0c26be4c991d677--eis_report_38234_2023NEI_facility_summary_21jul2026.zip
#> [[1]]
#> [1] 0.6792185 0.6792185 0.6792185
#>
#> [[2]]
#> [1] 0.338991 0.338991 0.338991
#>
#> [[3]]
#> [1] 0.6506333 0.6506333 0.6506333
#>
#> [[4]]
#> [1] 89.78028 89.78028 89.78028
#>
#> [[5]]
#> [1] 0.1927789 0.1927789 0.1927789
#>