What is the best way of converting a value from irregularly shaped poylgons to a polygon grid using PostGIS? I have a set of polygons that look like this:
and I would like to overlay a grid on these polygons, and assign values from the polygon to the grid value, proportional to the area of the polygon that intersects the grid. For example, where a grid intersects more than one polygon, I want to use the fraction of each polygon area that intersects with the gridcell to proportionally calculate the value.
My approach for doing this is as follows. Assuming each polygon has a value X_i and an area A_i, I calculate the density using D_i = X_i / A_i. Then, for each gridcell, I multiply the fraction of the polygon area that intersects that gridcell by the appropriate density value. I think this approach is satisfactory but I have not figured out a way of abstracting it so that it is easier for me to do this regularly.
I am curious to learn if there is a better way to do this, if there is a term for this process and if there is a function that exists to perform a calculation of this type.