Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

commonGrid

Determine A Common Spatial Domain And Pixel Resolution


Description

Determine a common spatial domain and pixel resolution for several spatial objects such as images, masks, windows and point patterns.

Usage

commonGrid(...)

Arguments

...

Any number of pixel images (objects of class "im"), binary masks (objects of class "owin" of type "mask") or data which can be converted to binary masks by as.mask.

Details

This function determines a common spatial resolution and spatial domain for several spatial objects.

The arguments ... may be pixel images, binary masks, or other spatial objects acceptable to as.mask.

The common pixel grid is determined by inspecting all the pixel images and binary masks in the argument list, finding the pixel grid with the highest spatial resolution, and extending this pixel grid to cover the bounding box of all the spatial objects.

The return value is a binary mask M, representing the bounding box at the chosen pixel resolution. Use as.im(X, W=M) to convert a pixel image X to this new pixel resolution. Use as.mask(W, xy=M) to convert a window W to a binary mask at this new pixel resolution. See the Examples.

Value

A binary mask (object of class "owin" and type "mask").

Author(s)

See Also

Examples

if(require(spatstat.core)) {
   A <- setcov(square(1))
   G <- density(runifpoint(42), dimyx=16)
   H <- commonGrid(A, letterR, G)
   newR <- as.mask(letterR, xy=H)
   newG <- as.im(G, W=H)
}

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.