Skip to contents

Download a TIGER/Line shapefile with boundaries for Kansas City or for a geography intersecting with Kansas City: county, census tract, census block group, census block, or zip code tabulation area (ZCTA). Files are downloaded from the US Census Bureau using the tigris package.

Usage

get_kc_sf(
  geo = c("place", "county", "tract", "block group", "block", "zcta"),
  year
)

Arguments

geo

The geography of the data set to download. "place" returns the city boundary geometry. All others return geometries that intersect with the city boundary.

year

The year of the data set to download.

Value

A dataframe of class sf containing a simple feature list column.

Details

Geographies that intersect with the city boundary are circumscribed to the city boundary if they are not fully within the city.

These columns are added to the shapefiles for all geographies other than "place":

  • area: the total area of the feature

  • kc_area: the area of the feature contained within the city boundary

  • kc_area_pct: the percentage of the feature within the city boundary

Area is calculated by sf::st_area().

Examples

if (FALSE) { # \dontrun{
get_kc_sf("tract", 2024)
} # }