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

Pulling the school districts-error #10

Open
Kicsbr opened this issue Jul 1, 2021 · 7 comments
Open

Pulling the school districts-error #10

Kicsbr opened this issue Jul 1, 2021 · 7 comments

Comments

@Kicsbr
Copy link

Kicsbr commented Jul 1, 2021

Hi,
I am trying to pull a state shapefile and it seems that something is 'broken'. I found the website with the example of using leaidr package, and when I run the line it give this message:

tn <- lea_get("tn")
trying URL 'https://github.com/datalorax/us-district-shapefiles/raw/master/individ-districts/47.dbf'
Content type 'application/octet-stream' length 210592 bytes (205 KB)
downloaded 205 KB

trying URL 'https://github.com/datalorax/us-district-shapefiles/raw/master/individ-districts/47.prj'
Content type 'text/plain; charset=utf-8' length 147 bytes
downloaded 147 bytes

trying URL 'https://github.com/datalorax/us-district-shapefiles/raw/master/individ-districts/47.shp'
Content type 'application/octet-stream' length 7345380 bytes (7.0 MB)
downloaded 7.0 MB

trying URL 'https://github.com/datalorax/us-district-shapefiles/raw/master/individ-districts/47.shx'
Content type 'application/octet-stream' length 1364 bytes
downloaded 1364 bytes

Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, :
Cannot open layer

I tried with other states, and it gives me the same error. Am I doing this correctly? I have installed all the pacakges that the Isabella's webiste asked, but still fails.

By the way, my project is a survey at the school districts in IA, and what you have here is exactly what I needed. I just cannot figure out what is wrong.

Thanks.

Ki

@ivelasq
Copy link
Owner

ivelasq commented Jul 1, 2021

Hello!

Thanks for writing. I am glad that you are interested in {leaidr} and sorry that you're running into issues.

Could you please let me know when you installed the package? It underwent some changes, and maybe that's why the lea_get() didn't work. Another thing is to make sure all the packages that {leaidr} depends on are updated, as well.

Here was how I was able to get the Iowa school districts:

devtools::install_github("ivelasq/leaidr", force = TRUE)

library(leaidr)

ia <- lea_get("ia")

ia %>% 
  sf::st_as_sf() %>% 
  ggplot2::ggplot() +
  ggplot2::geom_sf()

Let me know if reinstalling the package works! Thanks.

@Kicsbr
Copy link
Author

Kicsbr commented Jul 1, 2021

I have installed it this morning and used the same exact same code and it is not working. However, it is possible that this is a fault on my end. My R 4.0. 3 and RStudio 1.4.1103 are the portable versions at the office, and these older versions may the culprit. I will install the R 4.1.0 and see if error persists. I was able to bring the SD map using your code from an early post, but I was trying to see if this newer version was better.

By the way, I would love to see if the package could combine the school districts as in "sf" package that allows simple feature (sf) objects to be dissolved into one. This is because in IA there are 9 area education agencies that groups close to 300 school districts, and some of the maps that I would like to make will be in these 9 regions. I am not a developer, so I have no clue how to do this, but if you need any input on what I mean for this, I will be more than happy to share.

Thank you for your prompt response and your time.
Ki

@ivelasq
Copy link
Owner

ivelasq commented Jul 16, 2021

Hi there! Just following up - were you able to resolve the issue @Kicsbr ?

@Kicsbr
Copy link
Author

Kicsbr commented Jul 16, 2021 via email

@ivelasq
Copy link
Owner

ivelasq commented Jul 19, 2021

Hi there! Sorry to hear that it didn't end up working. I haven't tried grouping geographies before. What is the name of the package?

@Kicsbr
Copy link
Author

Kicsbr commented Jul 19, 2021 via email

@CountingBeeps
Copy link

CountingBeeps commented Nov 24, 2022

The package won't work for me either. Same issue.

Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv,  : 
  Cannot open layer
In addition: Warning messages:
1: OGR support is provided by the sf and terra packages among others 
2: OGR support is provided by the sf and terra packages among others

I just installed your package, and I'm on the newest versions of R and RStudio. Not the portable ones either,

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

3 participants