Can't say I've often used the make groups tool without the fuzzy match companion, but it was useful today.
Part 1 was super-fun - part 2 is very doable in regular code, but my brain has melted while trying to figure out how to do this in BASEA
Part 1 below - part 2 to follow once the brain recovers.
And then transpose this to be able to find the minimum of all neighbours and filter down to these:
OK - here's part 2. This one was my favourite so far 'cause once you've prepared the raw materials - the macro part is SUPER clean.
Then determine the ones that are low-points and send them into the basin finder:
The Basin Finder is really simple after you do all this prep. All you do is you join the current cell to all its neigbours, filter for ones going downhill or 9s - and then repeat
This one hurt, but I got there in the end. I thought I was unique in using spatial to figure this out but reading through the thread this was quite common. I probably could have been more efficient but this took me 3 days :'(
I created 10,000 polygons and then split out the 9s to make a polygon which i then cut from the larger polygon to give me basins. I then divided the whole area by 10,000 to work out the area per square and divided the basins by this to get the answer