[R-sig-Geo] R chrashes when reading vector from GRASS with readVECT6

Roger Bivand Roger.Bivand at nhh.no
Tue Mar 11 14:20:32 CET 2008


On Tue, 11 Mar 2008, Michal Gallay wrote:

> Dear R experts,
>
> I am running R 6.2.2 and QGIS 0.8.1 on WinXP, 1.5 GB RAM, 1.8GHZ processor.
>
> When I try to read a vector point dataset from a GRASS mapset
> R looks like its working but it goes on for a very long time
> even if the point dataset is small (1400 points).
> After hitting ESC to terminate the process, R crashers.
>
> require(spgrass6)
>> gmeta6()
> gisdbase    D:/GIS_data/GB_data/GRASS
> location    4_Langdale
> mapset      RST_ground_truth
> rows        290
> columns     400
> north       507450
> south       506000
> west        328000
> east        330000
> nsres       5
> ewres       5
> projection  NA
> cv.vect <- readVECT6("cv.points")
>
> However, sometimes after closing R and openning again I managed to read the
> data and sometimes not. It appears to be more or less random behaviour.
>
> Now, I wanted to read a big vector (1 million points). R crashes again.
> There is no problem with readRAST6() even with a big raster.
>
> Would you have any ideas where the problem is?

This is a question for the statgrass list, really. The GRASS port to 
Windows for QGIS is highly experimental, and must be treated as unstable. 
The R-GRASS interface works with GRASS 6 under Cygwin, and the native 
Windows ports (QGIS is one, initially not by the GRASS team, the GRASS 
team is working on a second which is not ready yet), should not yet be 
relied on for production. By the way, the current QGIS release is 0.9.1, 
and 0.9.2 is at the second release candidate.

My guess would be that the system() commands in readVECT6 are generating 
code that the QGIS GRASS port doesn't always interpret correctly, for this 
combination of QGIS/GRASS/R/spgrass6/Windows - for instance a locale 
shadow on an escaped something? These problems are well nigh impossible to 
reproduce, even though they do happen. Are you running R as Rterm, or 
Rgui? I feel that there may be a QGIS event loop issue, that it isn't 
"paying attention".

I have seen different behaviour on different Windows machines with 
apparently similar QGIS/GRASS/R installations. If you need to interface 
QGIS 0.8.1 on Windows, please write out temporary vector files manually, 
and use readOGR() and writeOGR() in rgdal from inside R. Maybe things will 
improve, but likely not any time soon. If you have to use QGIS, try 
upgrading? Just running GRASS from the shell prompt is the easiest way, 
though, then everything *just works*TM.

Roger

>
> Thank you for your time and advice.
>
> Best regards
>
> Michal
>
>

-- 
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