View source: R/RSAGA-modules.R
rsaga.grid.to.points | R Documentation |
Convert SAGA grid file to point (or polygon) shapefile - either completely or only a random sample of grid cells.
rsaga.grid.to.points( in.grids, out.shapefile, in.clip.polygons, exclude.nodata = TRUE, type = "nodes", env = rsaga.env(), ... ) rsaga.grid.to.points.randomly(in.grid, out.shapefile, freq, ...)
in.grids |
Input: names of (possibly several) SAGA GIS grid files to be converted into a point shapefile. |
out.shapefile |
Output: point shapefile (default extension: |
in.clip.polygons |
optional polygon shapefile to be used for clipping/masking an area |
exclude.nodata |
logical (default: |
type |
character string: |
env |
RSAGA geoprocessing environment created by |
... |
Optional arguments to be passed to |
in.grid |
Input: SAGA grid file from which to sample. |
freq |
integer >=1: sampling frequency: on average 1 out of 'freq' grid cells are selected |
These functions use modules Grid Values to Points
(in some versions also called Grid Values to Shapes
) and Grid Values to Points (randomly)
in SAGA library shapes_grid
.
The SAGA 2.0.6+ version of this module is more flexible as it allows to create grid cell polygons instead of center points (see argument type
).
Alexander Brenning (R interface), Olaf Conrad (SAGA modules)
rsaga.add.grid.values.to.points()
## Not run: # one point per grid cell, exclude nodata areas: rsaga.grid.to.points("dem", "dempoints") # take only every 20th point, but to not exclude nodata areas: rsaga.grid.to.points.randomly("dem", "dempoints20", freq = 20) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.