Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Then I saved that 18x image in a Digital Elevation Model format and used gdaldem to generate hillshaded and hypsorelief images from the DEM. Finally, I used ImageMagick to blend the two together using parameters originally derived from the hypsorelief generation in TopOSM.
The code is at the bottom of my day 9 source file, in Common Lisp. (The AdvMAME3x code was something I originally wrote for my 2020 day 20 visualization.)
This amazing visualization reveals a kind of a bug in the basin generation algorithm: _any_ point which is not '9' belongs to some basin. That observation was a hint for this very short solution: we could simply exclude nines and count the connected components of the rest (my [source code](https://github.com/kirienko/adventofcode/blob/master/2021/day_09.py)_without the answer_: python + `networkx`).