Python Forum
How to give polygons a colour value with python? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: How to give polygons a colour value with python? (/thread-16968.html)



How to give polygons a colour value with python? - fzentner1987 - Mar-22-2019

Hey guys,

I'm working with arcpy since a few weeks and I have question and hopefully somebody knows how to deal with it.

I have a feature class with polygons, for example the second administration level for France. The feature class has an attribute which is called "colour_value". I have a list of six colour values like [59,63,70,72,78,82]. I want to give all polygons one of these values, which sounds easy, but it should be like that: the polygon with the 59 shouldn't have a neighbour polygon which has also the 59, and this rule also for the other values. How can I do that?

Thanks for help in advance.

Greets,
Fabian


RE: How to give polygons a colour value with python? - scidam - Mar-23-2019

I have never worked with Arcpy before,
but you have six colors! That's a lot, so, theoretically it is possible to solve your problem (even four colors would be sufficient).
Did you see the following thread? It might be helpful.