Thursday 12 January 2017

postgis - Calculate Color of Object So No Adjacent Objects Repeat


I am attempting to assign one of 16 colors to map objects (e.g. counties, states, ZIP Codes, etc.) so that no two adjacent objects share the same color.



I'm seeing tons of articles online about "edge coloring" and the "four color theorem," but I cannot seem to find a way to apply these theorems as an algorithm in PostgreSQL/PostGIS (or any practical application, for that matter).


I'm 100% sure this is a solved problem, but since Google isn't revealing an answer, I'm guessing I'm too ignorant on this topic to ask the right question.


Can someone point me in the right direction?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...