Skip to content
Prev 4464 / 29559 Next

Add Grid Values to Points

Hi Tim,

the most recent release of RSAGA has a wrapper function for this module 
that is called rsaga.add.grid.values.to.points; try this:

rsaga.add.grid.values.to.points("test", c("slope", "aspect"),
     "add_grid", method = "nearest.neighbour", env = myenv)

(Note that the wrapper function uses default file extensions.)

The problem with your call is that multiple file names have to be passed 
to SAGA_CMD in the form
    GRIDS=file1.sgrd;file2.sgrd;file3.sgrd
If you don't collapse the vector with semicolons, the geoprocessor will say
    GRIDS=file1.sgrd file2.sgrd file3.sgrd
and SAGA_CMD will assume that file2.sgrd is the next argument.
OK, maybe something to be changed in the next version of the 
geoprocessor, which is just a low-level workhorse.

rsaga.geoprocessor("shapes_grid", 0,
     param = list(SHAPES = "test.shp",
         GRIDS = paste(c("slope.sgrd", "aspect.sgrd"), collapse=";"),
         RESULT = "add_grid.shp", INTERPOL = 0),
     env = myenv)

I hope this helps...
   Alex
Tim H?ring wrote: