Introduction

The main objective of this paper is to map out and visualize the characteristics of municipal solid waste landfills in the US based on data collected by United States Environmental Protection Agency (EPA) [1].

setwd("C:/Users/dkkan/Desktop/Harrisburg/512 Data Viz/GIS")
landfill <- read_csv("landfill.csv")
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   `Landfill Name` = col_character(),
##   State = col_character(),
##   `Landfill Alias` = col_character(),
##   `Physical Address` = col_character(),
##   City = col_character(),
##   County = col_character(),
##   `Zip Code` = col_character(),
##   `Composting?` = col_character(),
##   `Ownership Type` = col_character(),
##   `Landfill Owner Organization(s)` = col_character(),
##   `Landfill Operator Organization` = col_character(),
##   `Current Landfill Status` = col_character(),
##   `Landfill Design Capacity (tons)` = col_number(),
##   `Waste in Place (tons)` = col_number(),
##   `Annual Waste Acceptance Rate (tons per year)` = col_number(),
##   `Does LF Recirculate Leachate` = col_character(),
##   `Leachate Recirc Frequency (Past 10 Yrs)` = col_character(),
##   `Permitted as RD&D LF` = col_character(),
##   `LFG Collection System In Place?` = col_character(),
##   `Flares in Place?` = col_character()
##   # ... with 1 more columns
## )
## See spec(...) for full column specifications.
names(landfill)<-stringr::str_replace_all(names(landfill), c(" " = "." , "," = "" ))

Methods

To conduct this analysis I used expss functions to create baseline statistical tabulations of Annual waste acceptance rate (tons.per.year) and Waste in place of landfills for different types of ownership. The average acceptance rate for annual waste and waste in place is higher in private ownership than public ownership.

landfill1<-landfill
landfill1$Annual_waste_AR<-landfill1$`Annual.Waste.Acceptance.Rate.(tons.per.year)`
landfill1 %>%
  tab_cells(landfill1$Annual_waste_AR, landfill1$`Waste.in.Place.(tons)`) %>%
  tab_cols(total(), Ownership.Type) %>%
  tab_stat_mean_sd_n() %>%
  tab_pivot() %>%
  htmlTable()
 #Total     Ownership.Type 
   Private   Public   Public/Private   Unknown 
 landfill1$Annual_waste_AR 
   Mean  209354.3   369211.7 126438.1 49579.9
   Std. dev.  369164.5   501722.4 234923.7 123351.5
   Unw. valid N  2231   774 1419 38
 landfill1$Waste.in.Place.(tons) 
   Mean  5620511.9   9305153.5 3612427.2 3600000 576668.7
   Std. dev.  9889165.3   11883159.7 7913479.4 1687258.1
   Unw. valid N  2167   782 1351 1 33

Results

Location of Annual Waste Acceptance Rate within each Landfill in Mainland United States

I created a map that showing Landfills within three categories of Annual Waste Acceptance Rate. The map also showing that the highest Annual Waste Acceptance Rate is in Northeast region and Mid-west region. I used Radius with different category levels.

data1 <- landfill[c(3,4,10,11,13,24,26)]

df<-data1[!data1$Landfill.Name == "Ordot Landfill",]

df1<-df[!df$Landfill.Name == "Layon Municipal Solid Waste Landfill",]
df1$Annual_waste<-df1$`Annual.Waste.Acceptance.Rate.(tons.per.year)`
df1<-na.omit(df1)

m <-
  leaflet(df1) %>%
  addProviderTiles(providers$CartoDB.Positron) %>%
  setView(-97, 37, zoom = 4)%>%
  addCircleMarkers(df1$Longitude,df1$Latitude,
                   popup = df1$Landfill.Name,
                   radius = df1$Annual_waste/200000,
                   fillOpacity = .2,
                   color = ifelse(df1$Annual_waste <=41788, 
                                  "blue", 
                                  ifelse(df1$Annual_waste <=186472, 
                                         "green", 
                                         "orange")))
 m%>% addLegend(position = "topright",
    colors = c("blue", "green", "orange"), 
    labels = c("LowRate", "MediumRate", "HighRate"),
    title = "Annual Waste Acceptance Rate")

Total counts of Landfills in Pennsylvania state and a rectangle layer to focus on Harrisburg City.

I created a map that showing the Count of Landfills in Pennsylvania within different Annual Waste Acceptance Rate categories. I used county shapefile to add polygon layer to highlight Pennsylvania state and then I created a Rectangle layer to emphasize on Harrisburg city. The Pennsylvania state has 32 landfills with low, 3 landfills with medium, and 18 landfills with high Annual Waste Acceptance Rate.

df2<-df1[df1$State=='PA',]
df2$color<-ifelse(df2$Annual_waste <=41788, 
                                  "LowRate", 
                                  ifelse(df2$Annual_waste <=186472, 
                                         "MediumRate", 
                                         "HighRate"))

count<-data.frame(table(df2$color))
counties<-readOGR(dsn=".",
                  layer="cb_2016_us_county_500k") #USA counties
## OGR data source with driver: ESRI Shapefile 
## Source: "C:\Users\dkkan\Desktop\Harrisburg\512 Data Viz\GIS", layer: "cb_2016_us_county_500k"
## with 3233 features
## It has 9 fields
## Integer64 fields read as strings:  ALAND AWATER
pa<-counties[counties@data$STATEFP==42,]


m%>%
  fitBounds(-74.194527, 41.603323, -78.90208, 38.9903) %>% 
  addRectangles(-76.3867, 39.9732, -77.5867, 40.7732,
                color = "black", opacity = 5,
                fillColor = "transparent")%>%
  addLegend(position = "topright",
    colors = c("blue", "green", "orange"), 
    labels = c(paste0("LowRate-",count[1,2]), paste0("MediumRate-",count[2,2]), paste0("HighRate-",count[3,2])),
    title = "Count of PA Annual Waste Acceptance Rate") %>%  
  addPolygons(data = pa, # Graham Greene counties filled in red
              fillColor = "red", 
              color = NA, 
              fillOpacity = .1)

Location of Landfills in Regions of Florida state with Current Landfill Status

I created a map by merging county shapefile(FL) and florida regions file then I used Current Landfill Status variable to plot and see which region has how many open and closed landfills.

counties<-readOGR(dsn=".",
                  layer="cb_2016_us_county_500k") #USA counties
## OGR data source with driver: ESRI Shapefile 
## Source: "C:\Users\dkkan\Desktop\Harrisburg\512 Data Viz\GIS", layer: "cb_2016_us_county_500k"
## with 3233 features
## It has 9 fields
## Integer64 fields read as strings:  ALAND AWATER
pac<-counties[counties@data$STATEFP==12,] # use a subset for Florida only
centers <- data.frame(gCentroid(pac, byid = TRUE)) 
centers$Name<-pac@data$NAME  

n<-leaflet() %>% setView(-81.5158,27.6648,zoom=7) %>%
  addPolygons(data=pac, weight=.4) %>% 
  addLabelOnlyMarkers(data=centers,lng=~x,lat=~y,label= centers$Name,
                      labelOptions = 
                        labelOptions(noHide = TRUE, direction = 'center', textOnly = TRUE))

library(RCurl)
regions<- read_csv("Florida_regions_byCity.csv")
## Parsed with column specification:
## cols(
##   Region = col_character(),
##   City = col_character()
## )
regions<-as.data.frame(regions)
setnames(regions, "City", "NAME")
merge<-merge(pac,regions,by="NAME")

df_new = landfill[c(3,4,10,11,18,26)]

state_fl<- subset(df_new, State == "FL", select = c("Landfill.Name","State", "Current.Landfill.Status","Latitude","Longitude"))

open_landfill<-subset(state_fl, state_fl$Current.Landfill.Status == "Open", select = c("Latitude", "Longitude","Current.Landfill.Status","State"  ))

closed_landfill<-subset(state_fl, state_fl$Current.Landfill.Status == "Closed", select = c("Latitude", "Longitude","Current.Landfill.Status","State"  ))

pal<-colorFactor(c("red","blue","green","yellow","plum","orange"), domain = merge$Region)
pal1<-colorFactor(c("red", "darkgreen"), domain = state_fl$Current.Landfill.Status)
leaflet(merge) %>%
  addPolygons(fillColor =~pal(merge$Region),fillOpacity=.4, weight = 1) %>%
  addLegend(position=c("topright"),
            labels=merge$Region,pal=pal,values=~merge$Region, title = "Region")%>%
  addCircleMarkers(data = open_landfill, radius = 3, color = "darkgreen", weight = 2, opacity = 1, fill = TRUE, fillColor = "red", fillOpacity = 0.2, label = ~open_landfill$Current.Landfill.Status)%>%
  addCircleMarkers(data = closed_landfill, radius = 3, color = "Red", weight = 2, opacity = 1, fill = TRUE, fillColor = "green", fillOpacity = 0.2, label = ~closed_landfill$Current.Landfill.Status)%>%
  addLegend(position=c("topright"),
            labels=state_fl$Current.Landfill.Status, pal=pal1,values=~state_fl$Current.Landfill.Status,
            title = "CurrentStatus")%>%
   addLabelOnlyMarkers(data=centers,lng=~x,lat=~y,label= centers$Name,
                      labelOptions = 
                        labelOptions(noHide = TRUE, direction = 'center', textOnly = TRUE))
## Assuming "Longitude" and "Latitude" are longitude and latitude, respectively
## Assuming "Longitude" and "Latitude" are longitude and latitude, respectively

Neighborhood Trash and Closest Landfill

Final map i created to show the trash from my neighborhood area (Boca Raton, FL) and the nearest landfill. I added a image for neighborhood trash and link for landfill.

####Image on Map Adds a student image to the map, and includes an arc (as explained in assignment directions) # from the image to the nearest recycling center.

img <- readPNG("map.png")
 grid.raster(img)

Bibliography

[1] United States Environmental Protection Agency (2019, December). Landfill Methane Outreach Program (LMOP). Retrieved from https://www.epa.gov/lmop/landfill-technical-data

[2] Leaflet package for interative maps- https://bookdown.org/robinlovelace/geocompr/adv-map.html Cohen, B. (2020, Summer). ANLY 512, Data Visualization.

[3] https://r-spatial.github.io/mapview/index.html