walkerke/tidycensus

get_decennial: geometry data download failed.

Closed this issue · 1 comments

Hi -

Tried this -

get_decennial(geography = "block", variables = "P001001", year = 2000, sumfile = "sf1", state = 'CA', county = '037', geometry = T)

Response -

Getting data from the 2000 decennial Census
Downloading feature geometry from the Census website. To cache shapefiles for use in future sessions, set options(tigris_use_cache = TRUE).
Using FIPS code '06' for state 'CA'
Using Census Summary File 1
Error : Cannot open "C:\Users\jbutt\AppData\Local\Temp\Rtmpm83m6r"; The source could be corrupt or not supported. See st_drivers() for a list of supported formats.
In addition: Warning message:
In unzip(file_loc, exdir = tmp) : error 1 in extracting from zip file
Error: Your geometry data download failed. Please try again later or check the status of the Census Bureau website at https://www2.census.gov/geo/tiger/

Session information -

R version 4.4.2 (2024-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 22631)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8 LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8

time zone: America/Los_Angeles
tzcode source: internal

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] tidycensus_1.6.7

loaded via a namespace (and not attached):
[1] jsonlite_1.8.9 dplyr_1.1.4 compiler_4.4.2 crayon_1.5.3 tidyselect_1.2.1 Rcpp_1.0.13-1 xml2_1.3.6 stringr_1.5.1 tidyr_1.3.1
[10] uuid_1.2-1 readr_2.1.5 R6_2.5.1 generics_0.1.3 curl_6.0.1 classInt_0.4-10 sf_1.0-19 tigris_2.1 tibble_3.2.1
[19] units_0.8-5 DBI_1.2.3 pillar_1.10.0 tzdb_0.4.0 rlang_1.1.4 stringi_1.8.4 cli_3.6.3 withr_3.0.2 magrittr_2.0.3
[28] class_7.3-22 rvest_1.0.4 grid_4.4.2 rappdirs_0.3.3 hms_1.1.3 lifecycle_1.0.4 vctrs_0.6.5 KernSmooth_2.23-24 proxy_0.4-27

The temp file is located at C:\Users\*****\AppData\Local\Temp\Rtmpm83m6r. It contains an empty zip archive tl_2010_06037_tabblock00.zip. I checked the Census Bureau ftp and found https://www2.census.gov/geo/tiger/TIGER2010/TABBLOCK/2000/tl_2010_06037_tabblock00.zip so the file seems to be available.

If I leave off geometry = T, the request returns data.

Any idea what's going on? Thanks!

I just ran your code successfully. My guess is that it was a connection hiccup on the Census side, or possibly on your side (blocks can be a hefty download). Give it another try and see if it'll work.