I have been using readOGR() to load in a shapefile of UK postcodes by region (Areas), downloaded from this website : https://www.opendoorlogistics.com/downloads/
uk_maps <- readOGR(".", "Areas")
Which loaded in the .dbf, .fix, .prj, .shp, .shx files without any problem and I was able to plot the blank map of the UK. (notably a 124-row file documenting the broad region postcodes).
Then when I reset my code, as usual, to try out new flows, I now get the following error:
Error in readOGR(".", "Areas") : no features found De plus : Warning message: In ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, : ogrInfo: all features NULL
And I have no idea why I get this because I haven't changed the files in any way. I've just tried to redownload the shapefiles from the website link above, put them in a new working directory, set it, and the same error happens.
What's going on?
Best,
Cameron
OMG I think I solved the issue which was pretty stupid, don't know if this question should be deleted or left for Mac users.
Users of iCloud may know that iCloud sometimes randomly stores files in the Cloud to optimise storage, and when that's the case the file still appears in your directory but is actually not there (cloud sign next to the file).
In my case all of my .shp files where "clouded" (including District and Sectors) so I was mistakenly thinking there was an issue elsewhere
You have to really make sure none of your files are stored in the Cloud if you want R to read them properly.