Create a Raster from a Reilly SpatialPointsDataFrame

Description

This function creates a raster from a regularly spaced Reilly SpatialPointsDataFrame (output of the reilly function).

Usage

1
rasterReilly(x, mask = NULL)

Arguments

x

sp object (SpatialPointsDataFrame); output of the reilly function.

mask

sp object (SpatialPolygonsDataFrame); this object is used to clip the raster. (optional)

Value

Raster of catchment areas values. The raster uses a RAT (ratify) that contains the correspondance between raster values and catchement areas values. Use unique(levels(rasterName)[[1]]) to see the correpondance table.

See Also

reilly, rasterReilly, plotReilly, CreateGrid, CreateDistMatrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(spatData)
row.names(spatPts) <- spatPts$CodHop
# Compute Reilly catchment areas from known points (spatPts) on a
# grid defined by its resolution
myreilly <- reilly(knownpts = spatPts, varname = "Capacite",
                   typefct = "exponential", span = 750, beta = 2,
                   resolution = 100, mask = spatMask)
# Create a raster of reilly values
myreillyraster <- rasterReilly(x = myreilly, mask = spatMask)
plot(myreillyraster, col = rainbow(18))
# Correspondance between raster values and reilly areas
head(unique(levels(myreillyraster)[[1]]))