Skip to content

Commit

Permalink
Merge pull request #51 from Metropolitan-Council/22-wastewater-data-s…
Browse files Browse the repository at this point in the history
…ourcing

Wastewater data, emissions
  • Loading branch information
eroten authored Feb 2, 2024
2 parents 6c1ca24 + 275b27c commit 62f1d2f
Show file tree
Hide file tree
Showing 85 changed files with 5,630 additions and 1,676 deletions.
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,49 @@ _energy/data-raw/eGRID2021_data.xlsx
_energy/data-raw/eGRID2021_summary_tables.xlsx

_energy/data-raw/egrid2022_summary_tables.xlsx

_energy/data-raw/ghg-emission-factors-hub-2021.xlsx

_energy/data-raw/~$ghg-emission-factors-hub-2021.xlsx

_energy/data-raw/eia-recs-region-2020.csv

_energy/data-raw/eGRID2021_data.xlsx

_energy/data-raw/eGRID2021_summary_tables.xlsx

_energy/data-raw/egrid2022_summary_tables.xlsx

_energy/data-raw/ghg-emission-factors-hub-2021.xlsx

_energy/data-raw/~$ghg-emission-factors-hub-2021.xlsx

_energy/data-raw/eia-recs-region-2020.csv

_energy/data-raw/eGRID2021_data.xlsx

_energy/data-raw/eGRID2021_summary_tables.xlsx

_energy/data-raw/egrid2022_summary_tables.xlsx

_waste/data-raw/wastewater/epa/all-state-inventory-tools_0/

_waste/data-raw/wastewater/epa/all-state-inventory-tools_0.zip

_transportation/data-raw/epa/state_ghg/allstateghgdatapy2023readme_100323_0/

_transportation/data-raw/epa/state_ghg/allstateghgdatapy2023readme_100323_0.zip

_transportation/data-raw/epa/state_ghg/Methodology-Report-Full.pdf

_energy/data-raw/ghg-emission-factors-hub-2021.xlsx

_energy/data-raw/~$ghg-emission-factors-hub-2021.xlsx

_energy/data-raw/eia-recs-region-2020.csv

_energy/data-raw/eGRID2021_data.xlsx

_energy/data-raw/eGRID2021_summary_tables.xlsx

_energy/data-raw/egrid2022_summary_tables.xlsx
Binary file added _energy/data/wastewater.RDS
Binary file not shown.
Binary file added _energy/data/wastewater_meta.RDS
Binary file not shown.
223 changes: 0 additions & 223 deletions _energy/data_electricity.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,232 +18,9 @@ knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file())
source(file.path(here::here(), "R/_quarto_helpers.R"))
source(file.path(here::here(), "R/_load_pkgs.R"))
source(file.path(here::here(), "R/_leaflet_helpers.R"))
# MN
MN_inScopeUtilities <- read_rds(here(
"_energy", "data", "MN_electricity_inScope_utilityCountyPairs.RDS"
))
MN_allUtilities <- read_rds(here(
"_energy", "data", "MN_elecUtils.RDS"
))
# WI
WI_inScopeUtilities <- read_rds(here(
"_energy", "data", "WI_electricity_inScope_utilityCountyPairs.RDS"
))
WI_elecUtils_allTypes <- read_rds(here(
"_energy", "data", "WI_elecUtils_allTypes.RDS"
))
WI_inScope_elecUtils_fullServTerr <- read_rds(here(
"_energy", "data", "WI_inScope_elecUtils_fullServTerr.RDS"
))
hookaddcap()
```

## Utility Service Area Maps

To identify the utilities operating within our 11-county study area, we utilized data sets published by state sources. The outcome of our data collection, yielding a list of distinct utilities for which activity data should be collected, resides within distinct_electricity_util_WI.RDS (7 utilities, with four co-op utilities, three municipality utilities, and one investor-owned utility) and distinct_electricity_util_type_MN.RDS (18 utilities, with eight co-op utilities, nine municipality utilities, and one investor-owned utility)

### Minnesota

The Minnesota Public Utilities Commission publishes and maintains a map of electric utility service areas [@minnesotaitgeospatialinformationofficeElectricUtilityService2023]. Though this dataset is statewide(see fig. X), it is clipped to only include utility service areas within the nine Minnesota counties included in the study area of this inventory (see fig. Y -- note that utilities operating across county lines have a polygon covering the extent of their service territory within each and every county they operate within).

```{r minnesota-elec-servTerrs}
# Create a color palette
utilities <- unique(MN_allUtilities$mpuc_name)
color_palette <- colorFactor(palette = "viridis", domain = utilities)
# bounding box for Minnesota
bound_box <- list(
lng1 = -97, # Southwest longitude (closer in)
lat1 = 43.5, # Southwest latitude (closer in)
lng2 = -89.5, # Northeast longitude (closer in)
lat2 = 49 # Northeast latitude (closer in)
)
MN_elec_servTerrs <- council_leaflet() %>%
addPolygons(
data = MN_allUtilities %>% sf::st_transform(4326),
fill = TRUE,
fillColor = ~ color_palette(mpuc_name), # Use the color mapping
stroke = TRUE,
color = "gray",
weight = 2,
popup = MN_allUtilities$mpuc_name
) %>%
fitBounds(
lng1 = bound_box[[1]],
lng2 = bound_box[[3]],
lat1 = bound_box[[2]],
lat2 = bound_box[[4]]
)
MN_elec_servTerrs
```

```{r MN-elec-inScope-servTerrs}
# Create a color palette
inScopeUtilities <- unique(MN_inScopeUtilities$utility_name)
color_palette <- colorFactor(palette = "viridis", domain = inScopeUtilities)
# bounding box for MN study area counties
MN_bound_box <- list(
lng1 = -94.5, # Southwest longitude (further zoomed out)
lat1 = 44.7, # Southwest latitude (further zoomed out)
lng2 = -92, # Northeast longitude (further zoomed out)
lat2 = 45.5 # Northeast latitude (further zoomed out)
)
# Test basic functionality of the custom function
MN_elec_inScope_servTerrs <- council_leaflet() %>%
addPolygons(
data = MN_inScopeUtilities %>% sf::st_transform(4326),
fill = TRUE,
fillColor = ~ color_palette(utility_name), # Use the color mapping
stroke = TRUE,
color = "gray",
weight = 2,
popup = paste0(
MN_inScopeUtilities$utility_name,
", ",
MN_inScopeUtilities$county_name,
" County"
)
) %>%
fitBounds(
lng1 = MN_bound_box[[1]],
lng2 = MN_bound_box[[3]],
lat1 = MN_bound_box[[2]],
lat2 = MN_bound_box[[4]]
)
MN_elec_inScope_servTerrs
```

### Wisconsin

The Public Services Commission of Wisconsin publishes and maintains maps of service territories for electric utilities operating within the state. This data set relies upon, and is accurate to, "the extent that various sources \[utilities\] supplied accurate data." [@wisconsinpublicservicecommissionElectricServiceTerritories2024] This dataset spans the whole state of Wisconsin (see fig, X), and both clipped to the two Wisconsin counties included in the study area of this inventory (see fig. Y). However, because Wisconsin utilities do not report energy deliveries to the county level, we also generate a file with the entire service area of utilities that operate within Pierce and St. Croix County (see fig. Z), so that we can calculate population served by these utilities both within and without of our study area, as an input to estimated/modeled number of customer accounts and total energy deliveries to Pierce and St. Croix County.

```{r wisconsin-elec-servTerrs}
utilities <- unique(WI_elecUtils_allTypes$utility_name)
color_palette <- colorFactor(palette = "viridis", domain = utilities)
# bounding box for Wisconsin
bound_box <- list(
lng1 = -92.888, # Southwest longitude
lat1 = 42.491, # Southwest latitude
lng2 = -86.805, # Northeast longitude
lat2 = 47.080 # Northeast latitude
)
WI_elec_servTerrs <- council_leaflet() %>%
addPolygons(
data = WI_elecUtils_allTypes %>% sf::st_transform(4326),
fill = TRUE,
fillColor = ~ color_palette(utility_name),
stroke = TRUE,
color = "gray",
weight = 2,
popup = WI_elecUtils_allTypes$utility_name
# Temporarily comment out group for debugging
) %>%
fitBounds(
lng1 = bound_box[[1]],
lng2 = bound_box[[3]],
lat1 = bound_box[[2]],
lat2 = bound_box[[4]]
)
WI_elec_servTerrs
```

inscope

```{r wisconsin-elec-inScope-servTerrs}
# Create a color palette
inScopeUtilities <- unique(WI_inScopeUtilities$utility_name)
color_palette <- colorFactor(palette = "viridis", domain = inScopeUtilities)
WI_bound_box <- list(
lng1 = -92.9, # Southwest longitude
lat1 = 44.5, # Southwest latitude
lng2 = -92.0, # Northeast longitude
lat2 = 45.23 # Northeast latitude
)
WI_elec_inScope_servTerrs <- council_leaflet() %>%
addPolygons(
data = WI_inScopeUtilities %>% sf::st_transform(4326),
fill = TRUE,
fillColor = ~ color_palette(utility_name),
stroke = TRUE,
color = "gray",
weight = 2,
popup = paste0(
WI_inScopeUtilities$utility_name,
", ",
WI_inScopeUtilities$county_name,
" County"
)
) %>%
fitBounds(
lng1 = WI_bound_box[[1]],
lng2 = WI_bound_box[[3]],
lat1 = WI_bound_box[[2]],
lat2 = WI_bound_box[[4]]
)
WI_elec_inScope_servTerrs
```

InScope whole territory

```{r wisconsin-elec-inScope-wholeServTerrs}
# Create a color palette
inScopeUtilities <- unique(WI_inScope_elecUtils_fullServTerr$utility_name)
color_palette <- colorFactor(palette = "viridis", domain = inScopeUtilities)
# bounding box for Wisconsin
WI_bound_box <- list(
lng1 = -92.888, # Southwest longitude
lat1 = 42.491, # Southwest latitude
lng2 = -86.805, # Northeast longitude
lat2 = 47.080 # Northeast latitude
)
WI_elec_inScope_wholeServTerrs <- council_leaflet() %>%
addPolygons(
data = WI_inScope_elecUtils_fullServTerr %>% sf::st_transform(4326),
fill = TRUE,
fillColor = ~ color_palette(utility_name),
stroke = TRUE,
color = "gray",
weight = 2,
popup = paste0(
WI_inScope_elecUtils_fullServTerr$utility_name,
", ",
WI_inScope_elecUtils_fullServTerr$county_name,
" County"
)
) %>%
fitBounds(
lng1 = WI_bound_box[[1]],
lng2 = WI_bound_box[[3]],
lat1 = WI_bound_box[[2]],
lat2 = WI_bound_box[[4]]
)
WI_elec_inScope_wholeServTerrs
```

## Utility Activity Data

### Minnesota
Expand Down
10 changes: 0 additions & 10 deletions _energy/data_energy.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ hookaddcap()
```


{{< include data_electricity.qmd >}}

{{< include data_natural_gas.qmd >}}

{{< include data_propane_kerosene.qmd >}}





```{r echo=FALSE}
saveCap("energy-data")
```
Loading

0 comments on commit 62f1d2f

Please sign in to comment.