GRTS.polygon: Calculate a GRTS SpatialGridDataFrame based on a set of...

Description Usage Arguments Value Author(s) See Also Examples

Description

Creates a grid with given cell dimensions

Usage

1
2
  GRTS.polygon(spPolygon, cellsize, Subset = FALSE,
    RandomStart = FALSE)

Arguments

spPolygon

A SpatialPolygons object or a SpatialPolygonsDataFrame object that will define the bounding box or boundaries of the GRTS object.

cellsize

A single number defining the size of each grid cell.

Subset

A logical value indicating wether the entire GRTS grid should be returned (FALSE) or only the grid cell whos centroid fall inside object (TRUE). Defaults to FALSE.

RandomStart

A logical value indicating wether the GRTS grid should start at the minimum of the coordinates plus half the cellsize (FALSE) or at a random location (TRUE). Defaults to FALSE.

Value

A SpatialGridDataFrame if Subset == FALSE or a SpatialPixelsDataFrame if Subset == TRUE. The variable Ranking contains the randomised order of the cells.

Author(s)

Thierry Onkelinx Thierry.Onkelinx@inbo.be, Paul Quataert

See Also

GRTS, QuadratRanking

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(sp)
 Sr1 = Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2)))
 Sr2 = Polygon(cbind(c(5,4,2,5),c(2,3,2,2)))
 Sr3 = Polygon(cbind(c(4,4,5,10,4),c(5,3,2,5,5)))
 Sr4 = Polygon(cbind(c(5,6,6,5,5),c(4,4,3,3,4)), hole = TRUE)

 Srs1 = Polygons(list(Sr1), "s1")
 Srs2 = Polygons(list(Sr2), "s2")
 Srs3 = Polygons(list(Sr3, Sr4), "s3/4")
 SpP = SpatialPolygons(list(Srs1,Srs2,Srs3), 1:3)
 output <- GRTS(SpP, cellsize = 0.1)
 spplot(output)
 output <- GRTS(SpP, cellsize = 0.1, Subset = TRUE, RandomStart = TRUE)
 spplot(output)

GRTS documentation built on May 2, 2019, 6:39 p.m.