0

Context: I have a range of ACS data I work with, and I was looking to plot it at the block group level. However, I am struggling to find the relevant geometry objects to actually make such plots. TIGER files from census (which I think I used back in the early 2010s with geopandas) can't be loaded to gpd, and nowhere in the current TIGER documentation do they mention a data table with a geometry column.

This stands in contrast to numerous example codes online (eg. here and here) that just load TIGER uris into geopandas and implicitly have geometry in the loaded object.

Example code:

import geopandas as gpd
# input vars
state_id = 78
year = 2020
file_type='bg'

# load TIGER from URI
uri = f"https://www2.census.gov/geo/tiger/TIGER{year}/{file_type.upper()}/tl_{year}_{state_id}_{file_type.lower()}.zip"
example_blockgroups = gpd.read_file(uri)

gives TypeError: __init__() missing 1 required keyword-only argument: 'geometry'

As do other very basic loads of TIGER files like

gpd.read_file("https://www2.census.gov/geo/tiger/TIGER2020/STATE/tl_2020_us_state.zip")
gpd.read_file("https://www2.census.gov/geo/tiger/TIGER2017/STATE/tl_2017_us_state.zip")
gpd.read_file("https://www2.census.gov/geo/tiger/TIGER2019/TABBLOCK/tl_2019_01_tabblock10.zip")
Mark_Anderson
  • 1,229
  • 1
  • 12
  • 34
  • Can't reproduce this - trying this on GeoPandas 0.12.2 works fine. – Nick ODell May 30 '23 at 22:45
  • Thanks! Above is gpd==0.13.0. If I revert to gpd==0.12.2 I get a different error: `NotImplementedError: A polygon does not itself provide the array interface. Its rings do.`. What can you load in successfully? FWIW my gpd is using the fiona engine by default. Not sure if an engine change would help. – Mark_Anderson May 30 '23 at 23:07
  • Working fine for me too, on `geopandas==0.13.2`. – R_D Aug 18 '23 at 13:34

0 Answers0