Skip to content

a problem with readOGR

5 messages · Julien Salanié, Pascal Oettli, Roger Bivand

#
Hello,

To me, the following works:

setwd("D:/mydirectory/")
carte = readOGR(getwd(),layer="COMMUNE")

HTH,
Pascal

Le 18/01/2013 08:35, Julien Salani? a ?crit :
#
On Fri, 18 Jan 2013, Pascal Oettli wrote:

            
Yes, thanks for the reports. In the changes made for 0.8-*, an attempt is 
made for the ESRI Shapefile driver to read the LDID byte in the *.dbf file 
to indicate which character set is used for encoding. The current code is:

con <- file(paste(dsn, .Platform$file.sep, layer, ".dbf", sep=""), "rb")

which will fail if dsn is the shapefile itself, but pass if dsn is the 
data source name (the directory in which the shapefiles are placed). I'll 
try to patch this so that both ways of reading shapefiles work again, and 
report back when the fix is committed. The failure was in ogrInfo() inside 
readOGR() - running traceback() after the error would show this.

Best wishes,

Roger

  
    
#
On Fri, 18 Jan 2013, Roger Bivand wrote:

            
rgdal version 0.8-4 will resolve the problem, SVN revision 431. It has 
been submitted to CRAN. This is also related to

https://stat.ethz.ch/pipermail/r-sig-geo/2013-January/017210.html
https://stat.ethz.ch/pipermail/r-sig-geo/2012-December/016942.html

Roger