image2Grid {trip}R Documentation

Create a Grid from an image

Description

A simple function to convert an image (xyz list) into a SpatialPointsDataFrame.

Usage

image2Grid(x, p4 = NA)

Arguments

x an list with components "x" and "y" (cor and "z" like that used by image and contour
p4 a PROJ.4 string specifying the coordinate system used

Details

The coordinate vectors "x" and "y" may have the same length as the dimensions of matrix "z"

Value

A SpatialGridDataFrame with one column, "z".

Warning

....

Note

~~further notes~~

~Make other sections like Warning with section{Warning }{....} ~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

     # taken from image example
     x <- 10*(1:nrow(volcano))
     y <- 10*(1:ncol(volcano))
     im <- list(x = x, y = y, z = volcano)
     g <- image2Grid(im)
     image(im, col = terrain.colors(100), axes = FALSE)
     contour(g, add = TRUE)
     
     ## just in case there is any doubt
     image(g, xlim = c(100, 140), ylim = c(100, 140))
     abline(h = im$y+5, v = im$x+5)


[Package trip version 1.0-4 Index]