ourcodingclub / spatial-inla

Repository containing the data for the Hierarchical modelling using INLA tutorial on the Coding Club website
3 stars 4 forks source link

no features found error in UK_Shape #1

Open brianhuey opened 4 years ago

brianhuey commented 4 years ago

Running through the tutorial on Ubuntu and came across this error. Any thoughts would be appreciated, thanks!

> UK_Shape <- readOGR(dsn = "United Kingdom", layer = "gadm34_GBR_1")
Error in readOGR(dsn = "United_Kingdom", layer = "gadm34_GBR_1") : 
  no features found
In addition: Warning message:
In ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv,  :
  ogrInfo: all features NULL
IslaMS commented 4 years ago

Can you check out this stack overflow and see if it solves your issue? https://stackoverflow.com/questions/30561889/readogr-cannot-open-file

I think it is the path.expand() function and or providing a full path name that might help?

brianhuey commented 4 years ago

I tried the stackoverflow suggestions, but it still throws the error. It doesn't seem like a path issue to me, the error implies that it found the file it was looking for but no features are in it. I have gadm34_GBR_1.dbf, gadm34_GBR_1.cpg, gadm34_GBR_1.prj in the folder.

Lisa-Gecchele commented 4 years ago

hello, there was a problem with this because the shapefile did not load correctly (you don't have a shp in the folder atm). I'm working to fix it, but the UK shapefile is there only for data visualisation purposes, so you can skip this step, or you can download the original shapefile from https://gadm.org/index.html