Giter Club home page Giter Club logo

Comments (9)

walkerke avatar walkerke commented on July 24, 2024 1

@semiographics Ah, I see what's going on. The CB ZCTA file has not yet been released for 2021, so you are trying to download a file that doesn't exist. I need to put in an error message until they release it, I'll patch that shortly.

You can still get 2020 CB ZCTAs by putting in the argument year = 2020. Or, you can also get 2021 ZCTAs from the regular TIGER/Line dataset by removing the cb = TRUE argument.

from tigris.

walkerke avatar walkerke commented on July 24, 2024

Hmm. Can you try this for me?

library(rappdirs)

user_cache_dir()

Navigate to that directory on your machine and see if there is a tigris folder there - if so, enter it and see if any datasets are found inside. Are you on a work machine with heavy restrictions by chance?

If nothing is writing there this may be the case. In this instance try entering the command options(tigris_use_cache = FALSE) before running tigris commands, as this will tell tigris to download the shapefiles to a temporary directory instead, which may work.

from tigris.

ZellW avatar ZellW commented on July 24, 2024

Really appreciate the feedback.
Here are the results. (I believe it might be a Windows 10 change that is causing the problem.)
Installed rappdirs. The result of user_cache_dir() is "C:\Users\czwea\AppData\Local\Cache"
That folder does not exist on my machine (which I have admin rights to). I do have this folder:
C:\Users\czwea\AppData\Local\tigris\tigris\Cache
This folder is empty.
Entered: options(tigris_use_cache = FALSE)
This corrected my problem. plot(ua) as an example works.
Your help is much appreciated. Many thanks.
Cliff

Date: Fri, 29 Jan 2016 20:25:37 -0800
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [tigris] Unable to Download Shape Files (#14)

Hmm. Can you try this for me?

library(rappdirs)

user_cache_dir()

Navigate to that directory on your machine and see if there is a tigris folder there - if so, enter it and see if any datasets are found inside. Are you on a work machine with heavy restrictions by chance?

If nothing is writing there this may be the case. In this instance try entering the command options(tigris_use_cache = FALSE) before running tigris commands, as this will tell tigris to download the shapefiles to a temporary directory instead, which may work.


Reply to this email directly or view it on GitHub.

from tigris.

walkerke avatar walkerke commented on July 24, 2024

Ok great. Closing the issue for now but will investigate the Windows 10 issue, the folder you've described is the folder that tigris should be writing to.

from tigris.

semiographics avatar semiographics commented on July 24, 2024

Same problem as above.
If tigris_use_cache is set to TRUE, the download fails over and over.
If tigris_use_cache is set to FALSE, then
Error: Cannot open "...\Rtmp2NIlzp"; 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
I've gone around in circles for 2 hours. Installed the dev version, done everything everyone has suggested.

from tigris.

walkerke avatar walkerke commented on July 24, 2024

@semiographics can you post the code you've tried and the results of your sessionInfo()?

from tigris.

semiographics avatar semiographics commented on July 24, 2024

library(tigris)
library(sf)

zips <- zctas(cb=TRUE, starts_with="00601")
Retrieving data for the year 2021
Previous download failed. Re-download attempt 1 of 3...
|===============================================================================================================| 100%
Previous download failed. Re-download attempt 2 of 3...
|===============================================================================================================| 100%
Previous download failed. Re-download attempt 3 of 3...
|===============================================================================================================| 100%
Error: Download failed; check your internet connection or the status of the Census Bureau website
at http://www2.census.gov/geo/tiger/.

sessionInfo()

R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

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

other attached packages:
[1] rappdirs_0.3.3 sf_1.0-9 tigris_2.0 RPostgres_1.4.4

loaded via a namespace (and not attached):
[1] Rcpp_1.0.9 class_7.3-19 prettyunits_1.1.1 ps_1.7.2 assertthat_0.2.1 rprojroot_2.0.3
[7] digest_0.6.31 utf8_1.2.2 mime_0.12 R6_2.5.1 e1071_1.7-12 httr_1.4.4
[13] ggplot2_3.4.0 pillar_1.8.1 rlang_1.0.6 uuid_1.1-0 curl_4.3.3 rstudioapi_0.14
[19] miniUI_0.1.1.1 callr_3.7.3 urlchecker_1.0.1 blob_1.2.3 desc_1.4.2 devtools_2.4.4
[25] stringr_1.5.0 htmlwidgets_1.6.1 bit_4.0.5 munsell_0.5.0 proxy_0.4-27 shiny_1.7.4
[31] compiler_4.1.2 httpuv_1.6.7 pkgconfig_2.0.3 pkgbuild_1.4.0 htmltools_0.5.4 tidyselect_1.2.0
[37] tibble_3.1.8 fansi_1.0.3 crayon_1.5.2 dplyr_1.0.10 withr_2.5.0 later_1.3.0
[43] grid_4.1.2 xtable_1.8-4 gtable_0.3.1 lifecycle_1.0.3 DBI_1.1.3 magrittr_2.0.3
[49] units_0.8-1 scales_1.2.1 KernSmooth_2.23-20 cli_3.5.0 stringi_1.7.6 cachem_1.0.6
[55] fs_1.5.2 promises_1.2.0.1 remotes_2.4.2 ellipsis_0.3.2 generics_0.1.3 vctrs_0.5.1
[61] tools_4.1.2 bit64_4.0.5 glue_1.6.2 purrr_1.0.0 hms_1.1.2 processx_3.8.0
[67] pkgload_1.3.2 fastmap_1.1.0 colorspace_2.0-3 sessioninfo_1.2.2 classInt_0.4-8 memoise_2.0.1
[73] profvis_0.3.7 usethis_2.1.6

from tigris.

semiographics avatar semiographics commented on July 24, 2024

Aha...
Thanks for the quick response.
You know, it's funny because I pulled the whole set from the Cartographic Boundaries page yesterday and I recall that I had to go to the 2020 tab.
Here I am trying to help somebody on stackexchange who apparently doesn't know how to execute a join. Was trying to reproduce their code...
Thanks again.

from tigris.

bholtdwyer avatar bholtdwyer commented on July 24, 2024

Just a bump to suggest a clearer message when maps do not exist, as @walkerke suggests. When you ask for a year that doesn't exist the resulting error is quite opaque.

`

#Trying to pull the 2003 Census shapefile in using the tigris package:
counties_2003 = counties(state = "California", cb = TRUE, year = 2003)
|==================================================================================| 100%
Error: Cannot open "C:\Users\holtd\AppData\Local\Temp\RtmpycBSep"; 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
#Trying to pull the 2003 Census shapefile in using the tigris package:
counties_2003 = counties(state = "California", cb = TRUE, year = 2020)
|==================================================================================| 100%
Using FIPS code '06' for state 'California'
`

from tigris.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.