I have a shapefile of India with states (probably as polygons). I want to convert each polygon into equally divided cells ("raster" way), and populate (actually coloring) each cell by a value that would be calculated from an algorithm which is cell's location specific. This should be done for all the cells in the polygon (programmatically) so that at the end I have the shapefile, looking as a thematic (of what my algorithm calculates), raster image. I am not starting any image because the information is actually calculated value from algorithm and not coming from satellite imagery or anything like that.
In other words, it is not a vegetation or elevation thematic but something like population distribution, where each value (color) of cell represents a mean value of population there, showing wholly as a distribution at large scale.
Can any one please help how to do this using any open source application? (both as application and also programmatically using API like sharpmap) Please help