In QGIS, I have two vector layers - one vector layer is basically a grid, where each grid cell is of size 100x100m, while the other vector layer is Building Footprints data (a collection of polygons representing building outlines).
My requirement is to calculate the Mean Patch Area and Patch Count for every grid cell. I am trying to estimate these two metrics through the "Join Attributes By Location (Summary)" function -- but when I do so, I'm getting unexpected results.
These are the settings with which I executed the above function:
After execution, most of the grid cells are displaying the Mean Patch Area and Patch Count as expected - however, there are certain edge cases that are causing some issues. Consider this scenario, where a patch is overlapping with 2 grid cells:
My requirement is that the Grid Cell on the Top will only consider the portion of the patch that falls inside it, meaning that the Mean Patch Area will be very small when compared to the Mean Patch Area calculated for the Bottom Grid Cell. However, that doesn't seem to be the case; the Mean Patch Areas for the Top and the Bottom Grid cells are close (201 m.sq. and 245 m.sq.).
How, then, do I run this function such that such edge cases are also correctly estimated? I am trying with other predicates (overlap, contains etc.) as well - will update once I know more.