I have two files:
- a RasterStack (with 2 layers, each represents a raster map) named m_stack;
- A SpatialPointsDataFrame (points) named shph (with columns populated with data);
i can extract a buffer for each point (bdata) for each layer by doing:
bdata<-extract(m_stack,shph,buffer=60, cellnumbers=T)
bdata returns a list, row id's of the list are set automatically.
my problem is here: i need row id's of bdata to be id's from shph (obtained from a column in shph file named shph@data$ID. Any suggestion how to do this?
Kind regards, Manuel