Skip to content
Prev 26324 / 29559 Next

Error in reading shape file with readOGR()

On Tue, 13 Feb 2018, Adam Fera wrote:

            
The underlying GDAL logic expects an expanded path. Until I can check that 
using path.expand() inside the functions at least for reading, perhaps 
writing, use it as dsn = path.expand("~/relative/path/to/file/nypp_15c/"). 
I'd be grateful for feedback on whether this works as well as setwd().
sf uses enc2utf8(normalizePath(dsn)), so you could try normalizePath() 
too - path.expand() handles ~ but not ../.. . readGDAL() handles relative 
paths OK and uses normalizePath() internally.

Roger