R/extract.R

# Author: Robert J. Hijmans
# Date : October 2010
# Version 1.0
# Licence GPL v3

setMethod('extract', signature(x='Raster', y='vector'), 
function(x, y, ...){ 
	y <- round(y)
	return( .cellValues(x, y, ...) )
})


setMethod('extract', signature(x='Raster', y='sf'), 
function(x, y, ...){ 
	y <- .sf2sp(y)
	#if (is.list(x)) {}
	extract(x, y, ...)
}
)

Try the raster package in your browser

Any scripts or data that you put into this service are public.

raster documentation built on Jan. 5, 2021, 3:01 a.m.