rsaga.grid.to.points: Convert SAGA grid file to point shapefile

Description Usage Arguments Note Author(s) See Also Examples

Description

Convert SAGA grid file to point (or polygon) shapefile - either completely or only a random sample of grid cells.

Usage

1
2
3
4
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, ...)

Arguments

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: .shp). Existing files will be overwritten!

in.clip.polygons

optional polygon shapefile to be used for clipping/masking an area

exclude.nodata

logical (default: TRUE): skip 'nodata' grid cells?

type

character string: "nodes": create point shapefile of grid center points; "cells" (only supported by SAGA GIS 2.0.6+): create polygon shapefile with grid cell boundaries

env

RSAGA geoprocessing environment created by rsaga.env; required by rsaga.grid.to.points to determine version-dependent SAGA module name and arguments

...

Optional arguments to be passed to rsaga.geoprocessor

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

Note

These functions use modules Grid Values to Shapes (pre-2.0.6 name: Grid Values to Points) and Grid Values to Points (randomly) in SAGA library shapes_grid.

The SAGA 2.0.6+ module Grid Values to Shapes is more flexible than the earlier versions as it allows to create grid cell polygons instead of center points (see argument type).

Author(s)

Alexander Brenning (R interface), Olaf Conrad (SAGA modules)

See Also

rsaga.add.grid.values.to.points

Examples

1
2
3
4
5
6
7
## 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)

debangs/RSAGA documentation built on May 15, 2019, 1:53 a.m.