[R-sig-Geo] Error when reading shapefiles (readOGR) with rgdal

Antoine Gardarin Antoine.Gardarin at u-psud.fr
Tue Nov 2 16:07:02 CET 2010


Dear all

I am having problems when reading shapefiles using readOGR with the 
rgdal package. I have read several times these files in the past without 
any problem. Since a few days, while I apparently did not change 
anything (no update, similar version of R, same shapefiles), I always 
have this error with the following statement:

 > sol <- readOGR(dsn = ".", "sol")

 >> Erreur dans ogrInfo(dsn = dsn, layer = layer, 
input_field_name_encoding = input_field_name_encoding) :
 >> GDAL Error 4: Record count in .shp header is -3, which seems 
unreasonable. Assuming header is corrupt.

This error initially occurred with version 2.11.0 of R. I uninstalled R, 
installed the version 2.12.0 for Windows, I updated all the packages, 
but the trouble persists. The same files can be read on other computers 
of my colleagues, whatever the version of R and rgdal.

How can I solve this? Many thanks in advance.


Antoine



More information about the R-sig-Geo mailing list