-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Error in ogrInfo: Cannot open layer #16
Comments
I'll try it on one of my 3.2.4 systems in a bit. Still on the work Mac and I'm stuck at 3.2.3 on that till one of our pipelines is done. It's working fine on this setup tho:
|
Hmm... this is the second time this has been brought up (see #14) but the previous issue was on a different operating system. There seemed to be an issue with the cache directory that rappdirs was pointing to - I couldn't reproduce the error. |
Hmm, it seems to be a problem for tempdir() as well > library(rappdirs)
> user_cache_dir()
[1] "/Users/cpsievert/Library/Caches"
> list.files("/Users/cpsievert/Library/Caches/tigris")
[1] "cb_2014_us_county_500k.zip" "cb_2014_us_ua10_500k.cpg"
[3] "cb_2014_us_ua10_500k.dbf" "cb_2014_us_ua10_500k.prj"
[5] "cb_2014_us_ua10_500k.shp" "cb_2014_us_ua10_500k.shp.ea.iso.xml"
[7] "cb_2014_us_ua10_500k.shp.iso.xml" "cb_2014_us_ua10_500k.shp.xml"
[9] "cb_2014_us_ua10_500k.shx" "cb_2014_us_ua10_500k.zip"
> options(tigris_use_cache = FALSE)
> library(tigris)
> me <- counties("Maine", cb = TRUE)
Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, :
Cannot open layer
In addition: Warning message:
In unzip(file_loc, exdir = cache_dir, overwrite = TRUE) :
error 1 in extracting from zip file |
It appears as though In regards to library(tigris)
options(tigris_use_cache = FALSE)
me <- counties('Maine', cb = TRUE) Let me know if that still isn't working. |
Yep.
That worked, thanks! |
@cpsievert I believe I've fixed this issue in e2a0044. On occasion, Census downloads won't work (internet hiccup, the Census website is down, etc.). When this happens, tigris puts a folder in the cache directory anyway that will impede any future attempts to get the file. Now, adding the argument |
Works great, thanks! |
Great! Sending the update to CRAN shortly. |
Hi! I'm having similar troubles as those folks before me. I tried the solutions suggested in previous comments, but to no avail. Does anybody know where the problem is? Best regards,
locale: attached base packages: other attached packages: loaded via a namespace (and not attached):
Attaching package: ‘tigris’ The following object is masked from ‘package:graphics’:
|
Have a look at this open issue: #23. tigris currently supports Census boundaries from 2011 to the present; for 2010 boundaries, I recommend the UScensus2010 package. I'm leaving the issue open as I'll probably get to it at some point, but it isn't a top priority for me. I would welcome a pull request, however. |
Dear Kyle,
Thank you very much for your quick reply. I will try with the other package then. But I guess for Tiger/line files from earlier censuses (2000, 1990, 1980) there is no R package, right?
Kind regards,
Erich
From: Kyle Walker [mailto:notifications@github.com]
Sent: Wednesday, January 25, 2017 7:14 AM
To: walkerke/tigris <tigris@noreply.github.com>
Cc: STRIESSNIG Erich <striess@iiasa.ac.at>; Comment <comment@noreply.github.com>
Subject: Re: [walkerke/tigris] Error in ogrInfo: Cannot open layer (#16)
Have a look at this open issue: #23<#23>. tigris currently supports Census boundaries from 2011 to the present; for 2010 boundaries, I recommend the UScensus2010<https://cran.r-project.org/web/packages/UScensus2010/index.html> package.
I'm leaving the issue open as I'll probably get to it at some point, but it isn't a top priority for me. I would welcome a pull request, however.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#16 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AYKOoelSYHI4Rnud77zTPIWm7GkAGv8Cks5rV1i1gaJpZM4H4gri>.
|
There isn't an R package for boundaries that go back that far - however you can get historical boundaries from NHGIS: https://www.nhgis.org/ |
Thank you very much and thanks for providing such a great package!
Erich
From: Kyle Walker [mailto:notifications@github.com]
Sent: Wednesday, January 25, 2017 5:46 PM
To: walkerke/tigris <tigris@noreply.github.com>
Cc: STRIESSNIG Erich <striess@iiasa.ac.at>; Comment <comment@noreply.github.com>
Subject: Re: [walkerke/tigris] Error in ogrInfo: Cannot open layer (#16)
There isn't an R package for boundaries that go back that far - however you can get historical boundaries from NHGIS: https://www.nhgis.org/
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#16 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AYKOoWcEo3FCYY8VpwRchVMu03ZswSPpks5rV-y3gaJpZM4H4gri>.
|
hi i am having this issue with tigris using it rails() method i used Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, : code options(tigris_use_cache = FALSE) plot(rls) |
@Ahmed-qureshi |
I am having the same problem. adding "options(tigris_use_cache = FALSE)" did not help.
the error is this:
|
I am using MAC OS. |
Session Info
Edit: hmmm..... It just worked, 5 minutes later. The census database must have just been down |
I'll pile on to say I've been having this issue for the Here's my code: library(tigris)
options(tigris_use_cache = FALSE)
county_subdivisions("MA", cb=T, refresh=T) And the error: |
Hi @laurenmarietta - the version of tigris you are running is two years old, which may mean that you also have some other outdated packages. I'd recommend updating tigris to the latest version and also updating the sf package; my hunch is that this will solve the problem (I'm running your code without error). |
The text was updated successfully, but these errors were encountered: