four color theorem for symbolization | ArcGIS Pro 2.0?

3446
11
10-05-2017 05:16 AM
VincentLaunstorfer
Occasional Contributor III

Hi,

Since ArcGIS Desktop 9, I always found the four color theorem great to symbolized to depict layers with a lot of polygons (such as census tracts) so that no two adjacent polygons have the same color. It used to be called "Map Coloring - Four Color a Map" and basically applied the 4-color map theorem to a polygon file by adding a column with integers. Howerver, it never really worked under ArcGIS Desktop 10 and was desperate to use it again, as explained here:

https://community.esri.com/thread/27844 

I now installed ArcGIS Pro 2.0 and perhaps ESRI included this symbolization style in their new GIS desktop application? For the time being, I cannot find anything such as "4-color map" tool... Is it somewhere included? Or is there any workaround or script with the new ArcGIS Pro 2.0?

Thanks

0 Kudos
11 Replies
DanPatterson_Retired
MVP Emeritus

From a blog post a couple of years ago on the 'new' colors in Pro

And for those interested in color ColorBrewer site

0 Kudos
VincentLaunstorfer
Occasional Contributor III

Thanks Dan, but nothing more for the 4-color style, apart from a few comments at the end of the article. I wonder if there is a new script for ArcGIS Pro 2.0 (or ArcGIS 10.5.1) to compute integers in a field of a polygon file which are then used for symbolizing 4-color style...

0 Kudos
DanPatterson_Retired
MVP Emeritus

I haven't seen except

http://www.arcgis.com/home/item.html?id=5fa04ce288284c999f70464e1c3b2e82

that even remotely mentions color and Pro... but the search engine of Code Sharing site isn't very good

VincentLaunstorfer
Occasional Contributor III

I finally took some time to try out the Five Color Tool.

In ArcGIS Pro 2.0 it produced an error whereas in ArcGIS Desktop 10.5.1 it worked well. Although the tool did not behave as expected. Ii only calculated integers from 0 to 3, just like if integer 4 was not existing!

However, as shown below, is there anything wrong with the geoprocessing framework (Python in particular) in ArcGIS Pro? Or any wrong settings on my machine?

0 Kudos
DanPatterson_Retired
MVP Emeritus

you seem to have a mix of arcmap and ArcGIS Pro environments running.

where was the toolbox installed and were you running the toolbox from within the appropriate environment.

There is a script that allows you to verify whether tools in Pro can run scripts from arcmap

http://pro.arcgis.com/en/pro-app/tool-reference/main/arcgis-pro-tool-reference.htm

and this as well

http://pro.arcgis.com/en/pro-app/arcpy/get-started/python-migration-for-arcgis-pro.htm

So the last error is telling... either the environment or the tool can't be found.... 

ArcGIS pro uses its own anaconda distribution and everything should be contained there.  The tool can't be found suggests the location of the toolbox and its scripts aren't within the path that it will look into under normal circumstances.

VincentLaunstorfer
Occasional Contributor III

Thanks for that.

Unfortunately, I cannot decipher all the python Five Color Tool, but I still cannot understand either why it references to certain Desktop10.5 toolboxes... I cannot point out lines of code asking such toolboxes.

Where you comment helped is with my own Python script. Some of them did not work in Pro, and just removing references to Desktop10.5 toolboxes references made my scripts working in Pro!

#ArcGIS 10.5.1
#arcpy.AddToolbox("C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcToolbox\Toolboxes\Analysis Tools.tbx")
#arcpy.AddToolbox("C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcToolbox\Toolboxes\Data Management Tools.tbx")

0 Kudos
DanPatterson_Retired
MVP Emeritus

Those tools have an equivalent in Pro... just use Windows File explorer to search for *.tbx

probably here...

C:\__Your_Pro_Install_Folder__\Resources\ArcToolBox\Toolboxes

then check Arcpy's Toolbox functions

0 Kudos
JerryChase2
New Contributor II

I just downloaded and used http://www.arcgis.com/home/item.html?id=5fa04ce288284c999f70464e1c3b2e82 in ArcGIS Pro 2.0.1. I had no problems. I use it to symbolize Thiessen Polygons. I downloaded the zipped file, unzipped to a folder where I keep GIS tools. Added to my list of tools in Pro Catalog and opened from there. I hope this gives encouragement to others to try this tool. 

DanPatterson_Retired
MVP Emeritus

Jerry ... thanks for the report and nice to see that it works

0 Kudos