Problem: I have a series of nested grids. Example is below. I want to perform calculations for the smallest grid (grid with the smallest cells, green here) based on the values in the upper cells without performing an intersection method due to performance issues (my final grid has 4^10 cells).
Example: Assume, that we have 4 grids. The biggest one, red, has only 1 cell with the value 'A' in it. At the next level we have blue grid with 4 cells and values 'X, Y, B, Z' in it, etc. At the lowest level I have pink grid with 64 cells.
I want to calculate the list of upper values for the cells at the smallest grid. So, for the selected pink cell it will be: [A, B, C, D] because [A is the the value in the upper cell at the 1st grid, B is the value in the upper call at the 2nd grid and so on]
Solution ideas: As I've said, the idea here is not to perform intersection method due to its obvious exponential performance issues for the grid with a HUGE number of cells (4x2^10 at 10th level in my case, so it has to intersect each cell with 4x2^9 cells at the 9th level, 4x2^8 cells at the 8th, ...)
My idea was to somehow implement cell IDs based on their place in the grid. Walking from upper left to lower right corner and setting 1,2,3 or 4 value I get IDs making possible to split it based on the level I want to get value from. The problem here is to inherit values from the upper cells.
I can use GeoPandas, QGIS or PyQGIS if you write down the tutorial because I am not very familiar with PyQGIS syntax.