Hi List,

I have a shape file containing different Land use class. Such as
"Builtup", "Agriculture", "Forest" etc.
It has two attribute (id,class)
I want to create a data table which has four columns
(cell,weight,class,id) so that i can convert it into raster stack
where each raster layer will depict the fraction of class present in
the raster grid.

The each columns of data table
cell ---is the cell number of raster grid
weight--- is fraction of land use class in a grid
class---land use class
id----polygon id .

To achieve this I have written the following code but got stuck on
converting the extracted weight into data table.
Please help on this.
 ######################################################
library(maptools);library(rgeos);library(rgdal);library(raster);library(data.table)

shpFileDir='./lucc_shape';
layerName='2010';Gridsize=1000;

# Read  shape files and its attribute 
inputShape

	[[alternative HTML version deleted]]

