| 1 |
setClass("SpatialPixels", |
| 2 |
contains = "SpatialPoints", |
| 3 |
slots = c(grid = "GridTopology", grid.index = "integer"), |
| 4 |
validity = function(object) { |
| 5 |
if (nrow(object@coords) != length([email protected])) |
| 6 |
return("grid.index should have length equal to nrow(coords)") |
| 7 |
if (length([email protected]) > 0) { |
| 8 |
if (max([email protected]) > .NumberOfCells(object@grid)) |
| 9 |
return("grid.index max value too large") |
| 10 |
if (min([email protected]) < 0) |
| 11 |
return("grid.index min value too small") |
| 12 |
} |
| 13 |
return(TRUE) |
| 14 |
} |
| 15 |
) |
| 16 |
|
| 17 |
setClass("SpatialGrid", |
| 18 |
contains = "Spatial", |
| 19 |
slots = c(grid = "GridTopology"), |
| 20 |
validity = function(object) { |
| 21 |
return(TRUE) |
| 22 |
} |
| 23 |
) |