Description Usage Arguments Value Examples
View source: R/createArealGeometryObjects.R
Function to create objects inheriting from class Spatial
with an
area-measured character out of SpatialPoints or a SpatialPointsDataFrame.
The created spatial object covers the spatial extent of the input object.
1 2 | createSpatialArealObjFromPoints(x, desDim = 10,
out = "SpatialPolygons")
|
x |
an object of class |
desDim |
integer indicating the desired dimension of the return object along
the larger side of the bbox of the input object |
out |
the desired class of the return object |
an object of class SpatialPolygons
(default), SpatialPixels
or
SpatialGrid
as defined by the out
argument
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## load data
## Load example toy data
load(system.file("extdata","trajaggr_TestData.RData", package = "trajaggr"), verbose = FALSE)
require(sp)
# Create SpatialPolygons covering points of a TracksCollection
points <- as(TrColl, "SpatialPointsDataFrame")
spPoly <- createSpatialArealObjFromPoints(points)
class(spPoly)
# Create SpatialPixels
spPix <- createSpatialArealObjFromPoints(points, desDim = 8, out = "SpatialPixels")
class(spPix)
spPix
# Create a SpatiaGrid
pointsB1 <- as(Track_B1, "SpatialPointsDataFrame")
spGrid_B1 <- createSpatialArealObjFromPoints(pointsB1, desDim = 9, out = "SpatialGrid")
class(spGrid_B1)
slot(spGrid_B1, "grid")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.