## Reading layer `cb_2015_maine_county_20m' from data source `/Users/hrbrmstr/books/30-day-map-challenge/data/me-counties.json' using driver `TopoJSON'
## Simple feature collection with 16 features and 10 fields
## geometry type: MULTIPOLYGON
## dimension: XY
## bbox: xmin: -71.08434 ymin: 43.05975 xmax: -66.9502 ymax: 47.45684
## epsg (SRID): NA
## proj4string: NA
border <- st_union(texas)
### url = "ftp://newftp.epa.gov/EPADataCommons/OP/WalkabilityIndex.zip"
setwd("L:/00_Spatial/WalkabilityIndex/")
walkies <- st_read("Natl_WI.gdb", "WalkabilityIndex")
tx_walkies <- st_intersection(walkies, border)
#york_walkies <- st_intersection(me_walkies, york)
#me_walkies <- readRDS(here::here("me-walkies.rds"))
#york_walkies <- readRDS(here::here("york-walkies.rds"))
#rivers <- linear_water(state = "ME", "York", class="sf")
#water <- area_water(state = "ME", "York", class = "sf")
#rd <- roads(state = "ME", "York", class = "sf")
ggplot() +
geom_sf(data = border, color = "black", size = 0.75, fill=NA) +
geom_sf(data = tx_walkies, color = "white", size = 0.0725, aes(fill = WalkIndex)) +
geom_sf(data = texas, color = "#2b2b2b", size = 0.25, fill = NA) +
geom_sf_label(
data = texas, aes(label = NAME), family = font_es_bold, size = 4, lineheight = 0.875,
label.padding = unit(0.05, "lines"), label.size = 0, fill = "#ffffff33"
) +
scale_fill_viridis_c(
direction = -1, limits = c(0,20), name = "Walkability Index\n",
breaks = seq(0, 20, 5), labels = c("0 (Nigh impassable)", 5, 10, 15, "20 (Very walkable)")
) +
coord_sf(crs=albersusa::us_laea_proj, datum=NA) +
labs(
x = NULL, y = NULL,
title = "Walkability (At The Macro-Level) In Texas",
caption = "Data source: <ftp://newftp.epa.gov/EPADataCommons/OP/WalkabilityIndex.zip>"
) +
theme_ipsum_es(grid="") +
theme(plot.title = element_text(hjust = 0.5)) +
theme(legend.position = c(0.85, 0.25)) +
theme(legend.title = element_text(family = font_es_bold, hjust = 0.5)) +
theme(legend.box.background = element_rect(color = "#2b2b2b", fill = "white"))