[GRASS-stats] Speedup of readVECT6() with plugin

Roger Bivand Roger.Bivand at nhh.no
Mon Jun 2 04:16:14 EDT 2008


On Sun, 1 Jun 2008, Hamish wrote:

> Roger:
>>> the raster version is basic (uses data resolution not window
>>> resolution, and only handles one raster at a time without categories).
>
> Markus:
>> AFAIK the plugin delivers only *original* raster resolution
>> and extent (that's why r.out.gdal was written in C to replace
>> a former plugin based shell script).
>> So, unless the plugin is changed here it might not be that
>> useful for raster data *if* the GRASS behaviour of respecting raster
>> settings during export should be maintained.
>
> maybe the solution is just adding another line somewhere that does like
> if( wind.region != map.region )
>  r.mapcalc "tmp.R.outputmap.$$ = $inputmap"
> else
>  g.copy "$inputmap,tmp.R.outputmap.$$"
>
> ?
>
> Or do the commands have to come from the R side, so no GRASS module 
> commands can be used? Or else teach the user to do that 
> cropping/resampling first (which is not a very nice solution IMO).

Hamish,

The direct way (with R running inside but on top of GRASS, R CLI) is to 
use GRASS modules in system(). However, I'm close to using the discussion 
of earlier this year to parse the --interface-description output from XML 
to R-usable strings, so that it would be feasible to have a generic 
interface from R to GRASS modules. Would anyone be interested in my adding 
the draft code to the CVS site? If anyone would like to join in, I can 
move spgrass6 to svn on R-forge and invite developers - on the 
sourceforge cvs, all the sp modules have write access for developers, so 
it isn't so sensible.

With this available, the resampling could either be done by the user under 
better control than just using system() directly, or coded into the 
interface functions (still using system but under control of things like 
escaping). The code would be much cleaner than that currently used. I 
think the variants for native Windows/Cygwin/others will still have to 
co-exist, though.

Roger

>
>
> Hamish
>
>
>
>
>
>

-- 
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 grass-stats mailing list