[R-sig-Geo] problem with readOGR

"José M. Blanco Moreno" jmblanco at ub.edu
Wed Feb 25 12:02:07 CET 2009


Dear list members,
I have been trying to import a shapefile, but I am facing the following 
problem:
 > readOGR('.','SOU-0')
Error en ogrInfo(dsn = dsn, layer = layer, input_field_name_encoding = 
input_field_name_encoding) :
  Multiple # dimensions: 2:1364727026
 > ogrInfo('.','SOU-0')
Error en ogrInfo(".", "SOU-0") : Multiple # dimensions: 2:21374114

The problem seems to be with:
 > ogrFIDs('.','SOU-0')
[1]        0        1        2        3        4        5        
6        7        8        9
[...snipped content...]
[81]       80       81       82 21374112

I don't know why, but an integer seems to be imported as if it were 
double (or something like that!)
If I open the dbf file and save it (with e.g. MS Excel) as a dbase IV 
file, then it works. However, when I have to do this repeatedly it can 
be really annoying. Is there any way to overcome it? It is a documented 
issue (if so, excuse me)?

Thank you very much for any help that you can offer.

José M.

You can find the file here:
http://www.maplibrary.org/stacks/Africa/South%20Africa/KwaZulu-Natal/SOU-0_admin_SHP.zip

This is the information on the system:

 > sessionInfo()
R version 2.8.1 (2008-12-22)
i386-pc-mingw32

locale:
LC_COLLATE=Spanish_Spain.1252;LC_CTYPE=Spanish_Spain.1252;LC_MONETARY=Spanish_Spain.1252;LC_NUMERIC=C;LC_TIME=Spanish_Spain.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    
 > library(rgdal)
Loading required package: sp
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.6.0, released 2008/12/04
Path to GDAL shared files: C:/ARCHIV~1/R/R-28~1.1/library/rgdal/gdal
Loaded PROJ.4 runtime: Rel. 4.6.1, 21 August 2008
Path to PROJ.4 shared files: C:/ARCHIV~1/R/R-28~1.1/library/rgdal/proj
 > library(maptools)
Loading required package: foreign
 > readOGR('.','SOU-0')
Error en ogrInfo(dsn = dsn, layer = layer, input_field_name_encoding = 
input_field_name_encoding) :
  Multiple # dimensions: 2:1364727026
 > ogrInfo('.','SOU-0')
Error en ogrInfo(".", "SOU-0") : Multiple # dimensions: 2:21374114
 > ogrFIDs('.','SOU-0')
 [1]        0        1        2        3        4        5        
6        7        8        9
[11]       10       11       12       13       14       15       
16       17       18       19
[21]       20       21       22       23       24       25       
26       27       28       29
[31]       30       31       32       33       34       35       
36       37       38       39
[41]       40       41       42       43       44       45       
46       47       48       49
[51]       50       51       52       53       54       55       
56       57       58       59
[61]       60       61       62       63       64       65       
66       67       68       69
[71]       70       71       72       73       74       75       
76       77       78       79
[81]       80       81       82 21374112

-- 
---------------------------------------
José M. Blanco-Moreno

Dept. de Biologia Vegetal (Botànica)
Facultat de Biologia
Universitat de Barcelona
Av. Diagonal 645
08028 Barcelona
SPAIN
---------------------------------------

phone: (+34) 934 039 863
fax: (+34) 934 112 842



More information about the R-sig-Geo mailing list