Challenge 15: Food/drink
Another quick #30DayMapChallenge post. The prompt for day 15: Food/drink. Public Health Madison & Dane County have a dataset on health inspections which includes all licensed restaurants in the county. The data are not geocoded, and so I use the mapboxapi
package to geocode the locations:
establishments <- read_csv("data/Licensed_Establishment.csv")
# geocode and save geocoded data
# est_sf <- establishments %>%
# rowwise() %>%
# mutate(geometry = mb_geocode(AddressFull, output = "sf"),
# geometry = geometry$geometry)
#
# est_sf <- st_sf(est_sf)
#
# write_rds(est_sf, file = "data/licensed_establishment_geocoded.RDS")
est_sf <- readRDS("data/licensed_establishment_geocoded.RDS")
The dataset includes “all operational licensed establishments receiving routine inspections,” that is, not just restaurants. A quick tmap
(we have to filter out a food cart that’s located in Milwaukee):
Now we filter to only establishments that are of the type “Primarily Restaurant” and create a heat map. Heat maps look cool, but I admittedly don’t fully understand how leaflet.extras
generates them under the hood – certainly the map looks very different depending on the zoom level.
Text and figures are licensed under Creative Commons Attribution CC BY-SA 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".
For attribution, please cite this work as
Kliems (2022, Nov. 16). Harald Kliems: #30DayMapChallenge: Restaurant heat map of Madison. Retrieved from https://haraldkliems.netlify.app/posts/2022-11-16-food-establishment-data-from-madison/
BibTeX citation
@misc{kliems2022#30daymapchallenge:, author = {Kliems, Harald}, title = {Harald Kliems: #30DayMapChallenge: Restaurant heat map of Madison}, url = {https://haraldkliems.netlify.app/posts/2022-11-16-food-establishment-data-from-madison/}, year = {2022} }