Hi All,

 

I need help to write a code in R to subtract two raster in SAGA.

 

I have "DEM_1_f.sgrd" and "DSM_1_f.sgrd" in SAGA format and I wish to
subtract (DSM_1_f.sgrd - DEM_1_f.sgrd) to obtain a new layer 

 

A part of the code is this:

 

#A# DEM - 1) Shapes to Grid

rsaga.get.usage("grid_gridding", 3)

rsaga.geoprocessor(lib="grid_gridding", module=3,
param=list(GRID="DEM_1.sgrd", INPUT="ground.shp", FIELD=0, LINE_TYPE=0,
USER_CELL_SIZE=dem.pixelsize, [EMAIL PROTECTED],1],
[EMAIL PROTECTED],2], [EMAIL PROTECTED],1],
[EMAIL PROTECTED],2]))

# filter the missing values using neighbours:

rsaga.geoprocessor(lib="grid_tools", module=7,
param=list(INPUT="DEM_1.sgrd", RESULT="DEM_1_f.sgrd", THRESHOLD=0.1))

 

#A# DSM - 2) Shapes to Grid

rsaga.get.usage("grid_gridding", 3)

rsaga.geoprocessor(lib="grid_gridding", module=3,
param=list(GRID="DSM_1.sgrd", INPUT="vegetation.shp", FIELD=0, LINE_TYPE=0,
USER_CELL_SIZE=dem.pixelsize, [EMAIL PROTECTED],1],
[EMAIL PROTECTED],2],
[EMAIL PROTECTED],1],
[EMAIL PROTECTED],2]))

# filter the missing values using neighbours:

rsaga.geoprocessor(lib="grid_tools", module=7,
param=list(INPUT="DSM_1.sgrd", RESULT="DSM_1_f.sgrd", THRESHOLD=0.1))

 

#DCM = DSM - DEM

 

Rsaga.geoprocessor(???)

 

Thanks for help 

 

Ale

 

PS: is there a link with a SAGA and R codes banks

 

 


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to