Add Percentile Option to ZonalStats and FocalStats in Spatial Analyst

1537
6
12-18-2017 03:10 PM
Status: Open
GISSupport3
Occasional Contributor III

Hi All

Would be great to have access to this functionality.

6 Comments
XanderBakker

See discussion here: https://community.esri.com/thread/95403 

AxelThomas

allmost unbelievable that this functionality does not already exist - absolutely necessary for descriptive statistics.

WentaoChe

The Percentile Option should also be added to Focal Statistics tool. 

BrianPowell

Hi Xander,

I've been using your python script to do this for two years now and it has always worked great.  Until today when I tried it on a 32 bit signed integer raster I can't get passed this error:

Traceback (most recent call last):
File "C:\Python27\ArcGIS10.3\Scripts\percentilesTrinityWY16_bymask.py", line 140, in <module>
main()
File "C:\Python27\ArcGIS10.3\Scripts\percentilesTrinityWY16_bymask.py", line 79, in main
dct = {row[0]:row[1] for row in arcpy.da.SearchCursor(outname, flds_ras)}
RuntimeError: cannot open 'ras1'

Failed to execute (TrinityPercentilesbyMask).

It seems as though this is being caused by the temporary 'ras1' not having an attribute table.

Any thoughts?

Thanks

Brian

BrianPowell

It runs fine with a 16-bit raster but not a 32-bit raster, so I had to scale my values to 16-bit.  Anyway to get it to work with 32-bit?

NawajishNoman

Good idea! We are working on it, will be available in future release. Please stay tuned

Nawajish Noman

Esri