![[OC] How I Built Patterned Maps Without Adjacent Duplicates](https://preview.redd.it/odlx9fp54sah1.jpeg?auto=webp&s=926e07eb056a059efd02d07b629b0dcd4d63f105)
[OC] How I Built Patterned Maps Without Adjacent Duplicates
Finally solved a problem that looked simple… but wasn’t.
Geoglify can now apply SVG textures to polygons so that no two adjacent regions ever share the same pattern.
This isn’t about the Four Color Theorem. Using 4 patterns is easy. The challenge was distributing 28 different patterns across 242 countries while keeping the map visually balanced, accessible, and free of adjacent duplicates.
The whole algorithm runs in ~5ms using R-trees, edge hashing, and a randomized greedy graph coloring algorithm.
Full technical write-up:
https://leoneljdias.github.io/posts/map-coloring-patterns/
Try it:
https://geoglify.com