cellFromXY: Get cell number from row, column or XY

cellFromXYR Documentation

Get cell number from row, column or XY

Description

Get cell number(s) of a Raster*TS object from row and column numbers or X and Y coordinates.

Usage

## S4 method for signature 'RasterStackBrickTS,numeric,numeric'
cellFromRowCol(object, row, col)
## S4 method for signature 'RasterStackBrickTS'
cellFromXY(object, xy)

## S4 method for signature 'SpatRasterTS,numeric,numeric'
cellFromRowCol(object, row, col)
## S4 method for signature 'SpatRasterTS'
cellFromXY(object, xy)

Arguments

object

SpatRaster

col

integer. column number(s)

row

integer row number(s)

xy

matrix of x and y coordinates

Details

These functions are essentially a wrapper to cellFromRowCol and cellFromXY in raster package, work with Raster*TS objects.

Value

row, column or cell number(s). cellFromLine and cellFromPolygon return a list.

Author(s)

Babak Naimi naimi.b@gmail.com http://r-gis.net

Examples

## Not run: 
file <- system.file("external/ndvi", package="rts")

rt <- rts(file) # read the ndvi time series from the specified file
cellFromRowCol(rt,15,20)

cellFromRowCol(rt,c(16:20),c(11:15))

cellFromXY(rt,c(645000,57345000))

## End(Not run)


babaknaimi/rts documentation built on Oct. 3, 2023, 4:46 p.m.