testFUN: Example for use with tileProcess()

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Example function for use with tileProcess(); not run on its own.

Usage

1
testFUN(x, tempname)

Arguments

x

SpatialGridDataFrame of a tile within a larger GRASS raster.

tempname

Temporary filename used for GRASS output.

Details

This file processes a GRASS tile and writes out the processed SGDF to GRASS.

Value

tempname

Filename in GRASS (if multiple files were written, would be a vector of filenames).

Author(s)

Sarah Goslee <sarah.goslee@ars.usda.gov>

See Also

processTiles, testFUNR, gparse

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 

## The function is currently defined as
function (x, tempname) 
{
    x <- readRAST6("gssurgo")
    x@data[!is.na(x@data[, 1]), 1] <- 1
    writeRAST6(x, tempname)
    tempname
  }

	# how to run
    tileindex <- createTiles("dem30", tilesize=tilesize) 
    tileindex <- processTiles(tileindex, baserast="dem30", FUN=testFUN)
    mergeTiles(tileindex, blocksize=blocksize, outname=outname)
    removeTiles(tileindex)

## End(Not run)

phiala/grassR documentation built on May 25, 2019, 2:55 a.m.