An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130129/510af76f/attachment.pl>
(no subject)
3 messages · Ledile Mankga, Roger Bivand, Pascal Oettli
On Tue, 29 Jan 2013, Ledile Mankga wrote:
Dear list members
I am having a problem with reading a shapefile, please have a look at the
problem below:
koppen <- readOGR("GIS/Koppen_Geiger/koppen.shp", layer="koppen")
Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv =
use_iconv) :
Cannot open file
then I tried this again,
koppen <- readOGR(dsn="C:\\Users\\Ledile
emachines\\Desktop\\Modelling_species _distribution\\SDM course\\GIS\\Koppen_Geiger\\koppen.shp", layer="koppen") Error in file(paste(dsn, .Platform$file.sep, layer, ".dbf", sep = ""), : cannot open the connection In addition: Warning message: In file(paste(dsn, .Platform$file.sep, layer, ".dbf", sep = ""), : cannot open file 'C:\Users\Ledile emachines\Desktop\Modelling_species _distribution\SDM course\GIS\Koppen_Geiger\koppen.shp/koppen.dbf': No such file or directory
Please always provide the output of sessionInfo(). I am fairly certain that you have rgdal < 0.8-4, because this bug was fixed in 0.8-4 - see the first entry in: http://cran.r-project.org/web/packages/rgdal/ChangeLog In general you should pass the path to the layer as the dsn=, and the layer name as layer=. If you use the alternative form, use a complete path to the shapefile dsn, which would have worked here if you had updated rgdal. The same problem was mentioned and resolved in: https://stat.ethz.ch/pipermail/r-sig-geo/2013-January/017226.html Hope this helps, Roger
Roger Bivand Department of Economics, NHH Norwegian School of Economics, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no
Hello, Maybe the problem is the space in "Ledile emachines" and "SDM course". Try to put your files directly in "C:\", to see whether it solves the problem. HTH Pascal Le 29/01/2013 18:45, Ledile Mankga a ?crit :
Dear list members
I am having a problem with reading a shapefile, please have a look at the
problem below:
koppen <- readOGR("GIS/Koppen_Geiger/koppen.shp", layer="koppen")
Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv =
use_iconv) :
Cannot open file
then I tried this again,
koppen <- readOGR(dsn="C:\\Users\\Ledile
emachines\\Desktop\\Modelling_species _distribution\\SDM course\\GIS\\Koppen_Geiger\\koppen.shp", layer="koppen") Error in file(paste(dsn, .Platform$file.sep, layer, ".dbf", sep = ""), : cannot open the connection In addition: Warning message: In file(paste(dsn, .Platform$file.sep, layer, ".dbf", sep = ""), : cannot open file 'C:\Users\Ledile emachines\Desktop\Modelling_species _distribution\SDM course\GIS\Koppen_Geiger\koppen.shp/koppen.dbf': No such file or directory