Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
250 views
in Technique[技术] by (71.8m points)

r - ogrListLayers cannot open data source

I recently updated R and all of it's packages, and my code for reading in the layers of a geodatabase no longer works.

It works fine on my windows desktop, but doesn't work on my macbook (I change the filepath for the appropriate machine).

I get the same behaviour with any shapefile or geodatabase at any file path.

I'm essentially following the instructions listed here: Cannot open data source. .GDB in R

filegdblist <- paste("/Volumes/LaCie/2019 PRISM GIS clean/", list.files("/Volumes/LaCie/2019 PRISM GIS clean/"), sep = "")

subset(ogrDrivers(), grepl("GDB", name)) 

fc_list <- lapply(filegdblist, ogrListLayers)
Error in FUN(X[[i]], ...) : Cannot open data source

What strikes me as weird is that the results of other functions leads me to believe this should be working fine.

file.exists(filegdblist[1])
[1] TRUE

list.files(filegdblist[1])
 [1] "a00000001.freelist"                         
 [2] "a00000001.gdbindexes"                       
 [3] "a00000001.gdbtable"                         
 [4] "a00000001.gdbtablx"    
.....

Any suggestions as to what I should investigate?

question from:https://stackoverflow.com/questions/65852391/ogrlistlayers-cannot-open-data-source

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...