Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tigris places() error - API Issues? #195

Open
frumh002 opened this issue Feb 4, 2025 · 11 comments
Open

tigris places() error - API Issues? #195

frumh002 opened this issue Feb 4, 2025 · 11 comments

Comments

@frumh002
Copy link

frumh002 commented Feb 4, 2025

Hey there. I usually run this code as basic shapefile prep but today it's not working. I know a lot of federal sites have been going down so I'm just curious what might be going on or if the Census API is down? I don't think this code is wrong because I've run it hundreds of times but let me know.

> mn.places <- places(state = "MN")

Retrieving data for the year 2021
Using FIPS code '27' for state 'MN'
Warning: error 1 in extracting from zip fileCannot open layer tl_2021_27_place
Error: Opening layer failed.
@walkerke
Copy link
Owner

walkerke commented Feb 4, 2025

All the TIGER/Line datasets appear to be down as of this evening, unfortunately. tigris won't work as long as they are down, unless you have shapefiles previously cached.

@frumh002
Copy link
Author

frumh002 commented Feb 4, 2025

Ahh no worries. A sad day but we shall persist! Thanks for your work on this and let us know how we can support you and to maintain this incredible resource!

@walkerke
Copy link
Owner

walkerke commented Feb 4, 2025

For now, do this:

mn_cities <- arcgislayers::arc_read("https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/Places_CouSub_ConCity_SubMCD/MapServer/4", where = "STATE = '27'")

If you want Census-designated places, use layer 5 instead of 4.

@hannah-joseph
Copy link

Hi! I am also running into a similar issue today, and was wondering if you could also help me out? I am trying to retrieve county shapefiles from Yolo County, California. I usually use the tigris package before and had no issues, but today I am running into an error: "Error: Cannot open "C:\Users\Username\AppData\Local\Temp\RtmpuOgMFp"; The source could be corrupt or not supported. See st_drivers() for a list of supported formats."

This is my code: yolo <- tigris::counties("California", cb = TRUE) %>% filter(NAME == "Yolo" )

Thank you for your help!

@walkerke
Copy link
Owner

walkerke commented Feb 4, 2025

The Trump administration appears to have taken the files offline, so tigris won't work. I don't have a timeline for if, or when, they'll be back up.

@hannah-joseph
Copy link

I understand, thank you for your help regardless.

@njudd
Copy link

njudd commented Feb 5, 2025

Just dumping some code for whoever might need states.

tigris::states() #broken due to trump...
states <-arcgislayers::arc_read("https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/State_County/MapServer/18")

@nataliamush
Copy link

Anyone able to get county data from tigerweb.geo.census.gov? I'm getting 0 observations for anything I try to pull with arc_read or get_spatial_layer from arcpullr :(

@camille-s
Copy link

Hopefully this helps someone. I used folks' suggestions above with arc_read, starting with the TIGERweb endpoint, to get a list of all map services on that server. Then I subset those into a bunch that might be useful for my job or others in my network, extracted all the layers of those services, and batch wrote them out to gpkg files. The script could definitely be neater, and some of the files timed out, but I was able to download and save 314 of the 383 I identified. Here's the script, lots of love to my fellow data squirrels: https://gist.github.com/camille-s/3420cbdef8e4d5e227902181267ae9e6

@dfsnow
Copy link

dfsnow commented Feb 6, 2025

Seems the full FTP site is now back online (for now).

@frumh002
Copy link
Author

Thanks all - it does appear to be working now. As a side question, does tigris automatically chache things for the future? I've set the options to TRUE so it will search inside the cache first, but IDK if I have to set something to cache everytime? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants