[R-sig-Geo] readVECT6 temporary failure

Roger Bivand Roger.Bivand at nhh.no
Wed Apr 2 16:59:44 CEST 2008


On Wed, 2 Apr 2008, Facundo Muñoz wrote:

>
> Hello list,
>
> i've been dealing all day with this, and i can't find the problem.
> It suddenly begun to happen.
>
> Im working with GRASS 6.2.3 under CygWin, and with R 6.2.2 with the
> latest libraries (in fact, while trying to solve this problem, i removed
> all R versions, and reinstalled the latest. But is still failing).
>
> This is it:
> i start GRASS, and open the location i'm working with.
> then i start R from GRASS console, load spgrass6 library, and i transfer
> a vector map:
>
> 	GRASS> r --no-save
> 	R> library(spgrass6)
> 	R> medidas <- readVECT6("medidas")
>
> everything goes fine so far.

Is there a stray *.dbf file in the temporary directory? OGR with the ESRI 
Shapefile driver does not like extra *.dbf or other irregularities.

In situations like this, just side-step readVECT6, use 
system("r.out.ogr ...") to an arbitrary directory, and readOGR() from 
there. There are multiple components operating, so complete control is not 
possible, but I have seen problems with stray *.dbf files before that were 
hard to debug.

Roger

> but if i try to transfer some other vector map, it fails. In fact, if i
> just try to export a vector map to the temporary directory used by
> readVECT then:
>
> 	v.out.ogr input=ejes_1 type=line,boundary
> dsn=/home/usuario/grassdata/Valencia/geo_info/.tmp/facundo olayer=mmtest
> layer=1 format=ESRI_Shapefile
>
> 	ERROR 4: Unable to open
> /home/usuario/grassdata/Valencia/geo_info/.tmp/facundo/medidas.shx or
> /home/usuario/grassdata/Valencia/geo_info/.tmp/facundo/medidas.SHX.
> ERROR 4: Failed to open shapefile
> /home/usuario/grassdata/Valencia/geo_info/.tmp/facundo/medidas.shp.
> It may be corrupt.
>
>
> 	No se puede abrir el origen de datos OGR
> '/home/usuario/grassdata/Valencia/geo_info/.tmp/facundo'
>
>
>
> Note that while i tried to write a file called mmtest, the error talks
> about de previously wwritten file: medidas
> Besides, i can write fine to any other directory.
>
> So i go see what's going on in there, and i verify that after the first
> transfer is done there remains those files medidas.dbf and medidas.shp,
> which are responsible of the failure, since if i remove them manually,
> the failure stops.
>
> the problem arises only after de use of readVECT6. If i try to export a
> map to that directory it doesn't "hang" the directory.
>
> it looks as if the use of readVECT6 blocked the directory.
>
>
> Thank you in advance.
> Departament d'Estadística i Investigació Operativa
> Universitat de València (Estudi General)
> Facultat de Matemàtiques, Dr. Moliner 50, 46100 Burjassot, Spain.
> (+34) 96 354 3987, fax: (+34) 96 354 3238
> e-mail: Facundo.Munoz at uv.es
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, 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


More information about the R-sig-Geo mailing list