fill.Areas {sperich} | R Documentation |
Fill Algorithm
Description
This function fills all bounded areas in a grid.
Usage
fill.Areas(grid, landwatermask)
Arguments
grid |
A grid in which the areas should be filled. Cells with values greater than zero represent the bounds, cells with values lower or equal zero will be filled with value 1 if they are bounded. |
landwatermask |
A grid containing the land-water-information of the observed area. If a grid cell containes no land, the value of the cell in the landwatermask is -1, otherwise it is 0. Cells with negative values will not be filled. |
Details
This function fills all bounded areas in a grid.
Value
The grid with filled areas.
Author(s)
Maximilian Lange, Sven Lautenbach
Examples
##initialize data
m <- matrix(0,10,10)
m[2:8,2] <- 1
m[2:8,8] <- 1
m[2,2:8] <- 1
m[8,2:8] <- 1
##initialize mask (in this case: empty mask)
mask <- matrix(0,10,10)
##calculate the distance of the two points
m <- fill.Areas(m, mask)
image(m)
[Package sperich version 1.5-9 Index]