knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(councilR)

{councilR} has a couple functions and snippets to help you access and manipulate spatial data.

Snippets

Once you have installed snippets using councilR::snippets_install(), you will now have important values quickly accessible. To access them, start typing the snippet name into the console. The snippet will autocomplete.

metro_crs
#> 26915

metro_centroid
#> c(-93.30375,
#>   44.91831)

Functions

Some datasets are maintained on Minnesota Geospatial Commons. These datasets generally mirror datasets available in the internal GISLibrary. On Minnesota Geospatial commons, navigate to the dataset you want to access. Find the button to download the OGC GeoPackage format, and right click on it. Select "Copy link address". The address will end with ".zip".

Pass this link to import_from_gpkg() to get the sf object!

regional_parks_commons <- import_from_gpkg("https://resources.gisdata.mn.gov/pub/gdrs/data/pub/us_mn_state_metc/plan_parks_regional/gpkg_plan_parks_regional.zip")

head(regional_parks_commons)

If you can access internal databases, use your Council login user ID and password to access data from the GIS Library. For seamless access, see vignette("Options") to review package options.

regional_parks_db <- import_from_gis(query = "PARKSREGIONAL")

head(regional_parks_db)

A commonly fetched spatial dataset is the 7-county geography. fetch_county_geo() does just that.
You can also make a map quickly by using map_council_continuous(). This also adds a scale bar and cardinal indicator.

fetch_county_geo(progress_bar = FALSE) %>%
  map_council_continuous(.fill = ALAND) +
  ggplot2::labs(title = "Counties")

You can also fetch CTUs.

fetch_ctu_geo(progress_bar = FALSE) %>%
  map_council_continuous(.fill = ALAND) +
  ggplot2::labs(title = "CTUs")


Metropolitan-Council/councilR documentation built on March 30, 2024, 2:43 a.m.