[R-sig-Geo] writeOGR issue in dbf

caspar hallmann caspar.hallmann at gmail.com
Thu Mar 18 16:38:25 CET 2010


Dear list,

I am using writeOGR to create an ESRI shapefile from a
SpatialPointsDataFrame. When opening the shapefile in ArcMap and ask
for the attributes, I get an error "A column was specified that does
not exist".
Similarly, when opening the dbf of the shapefile in Paradox I get
"Unable to open table. Corrupt table/index header".
This does not only happen to my own Dataset but also the meuse data.

data(meuse)
coordinates(meuse)=~x+y
class(meuse)
writeOGR(meuse,".","test",driver="ESRI Shapefile")
# then try ArcMap or Paradox fails as mentioned above.
#Strangely, when i do
write.dbf(read.dbf("test.dbf"),file="test2")
#then renaming test2 into test, my attribute tables open up fine, and
Paradox stops complaining.

any clues?

Caspar.

> sessionInfo()
R version 2.10.1 (2009-12-14)
i386-pc-mingw32

locale:
[1] LC_COLLATE=Dutch_Netherlands.1252  LC_CTYPE=Dutch_Netherlands.1252
   LC_MONETARY=Dutch_Netherlands.1252 LC_NUMERIC=C
[5] LC_TIME=Dutch_Netherlands.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
 [1] pscl_1.03.3        coda_0.13-4        mvtnorm_0.9-9
automap_1.0-5      MASS_7.3-5         lme4_0.999375-32
Matrix_0.999375-33 maptools_0.7-29
 [9] lattice_0.18-3     foreign_0.8-39     raster_0.9.9-24
rgdal_0.6-24       gstat_0.9-66       sp_0.9-57

loaded via a namespace (and not attached):
[1] grid_2.10.1  tools_2.10.1



More information about the R-sig-Geo mailing list