Select to view content in your preferred language

Identify clusters that meet a threshold value

4393
10
05-05-2010 01:42 PM
by Anonymous User
Not applicable
Original User: dzaks

Given a raster dataset, I am looking to identify clusters comprised of the smallest number of grid cells that meet a given threshold value.

Is this possible? Any ideas on how to accomplish this?

Thanks!
0 Kudos
10 Replies
T__WayneWhitley
Frequent Contributor
Hi,

I'm using partition tools and need support.

When i run Partition tools -I have added a iterate feature by field 'geo_county', the model stop and show this error.

PYTHON ERRORS:
Traceback Info:
  File "C:\FERRAN\SOFT\0 GIS\SIG EXTENSIONS\DISTRICTING ARCGIS\AS16021\PartitioningTools\Scripts\Collocate.py", line 128, in <module>
    if count % (int(0.05 * tot_features)) == 0:

Error Info:
    <type 'exceptions.ZeroDivisionError'>: integer division or modulo by zero

Is a turnaround to this?

Thanks for your attention,

Ferran




See your duplicate thread...
I don't know if there are other errors in this script, probably not since I think you said you got some output before it crashed; however, clearly this is an error in the use of Python's modulus operator.  In the event of tot_features under 20, an unhandled error occurs.

Think you said you had limited experience w/ Python, but concerning the use of this operator in conjunction with the progressor functions----

...the general idea here:
Understanding the progress dialog box in script tools
Desktop » Geoprocessing » Creating tools » Creating tools with Python
http://resources.arcgis.com/en/help/main/10.1/index.html#//00150000002w000000

...useful samples here (demonstrating use of the modulus operator):
Controlling the progress dialog box
Desktop » Geoprocessing » Creating tools » Creating tools with Python
http://resources.arcgis.com/en/help/main/10.1/index.html#/Controlling_the_progress_dialog_box/001500...

(the 9.3 samples):
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Writing_messages_in_script_tools

Hope that helps.
0 Kudos