Natural Breaks Analysis Within Python

4783
3
11-28-2011 05:07 AM
JeremyTibbetts1
New Contributor
Hello all,
I have a field within a features class that needs to be classified base on natural breaks. I was wondering if there is way in python scripting to find the field within the FC and then determine the natural breaks within the data set? The number of categories I am going for is 5.

My skills in python are somewhat limited, i'm slowly learning as I go, but any help would be appreciated.

Thanks,

Jeremy
Tags (2)
0 Kudos
3 Replies
JeffBarrette
Esri Regular Contributor
In 10.0, the only way is to pre-author a layer file with all the appropriate information and then use arcpy.mapping.UpdateLayer.

At 10.1, we have introduced some symbology properties for some of the renderers that will allow you to change fields, number of classes, class breaks, etc.

Jeff
0 Kudos
KailaiZhang
New Contributor II
You might want to take a look at the Apply Symbology From Layer tool in 10:

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000006n000000

For 10.1, you can use the new RasterClassifiedSymbology class in the ArcPy Mapping module:

http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000005p000000

Kailai
0 Kudos
GalAvraham
New Contributor II
Jeremy
Take a look at this link - it includes an implementation of Jenks�?? Natural Breaks Algorithm, in Python.
http://danieljlewis.org/2010/06/07/jenks-natural-breaks-algorithm-in-python/

Keep in mind that the number of classes is yet to be determined by the user. Here's a direct the link to the algorithm:

http://danieljlewis.org/files/2010/06/Jenks.pdf

Cheers,
Gal
0 Kudos