AnsweredAssumed Answered

Different Results from ArcPro and Arc GIS 10.6

Question asked by hugh_a_graham340 on May 3, 2019
Latest reply on May 9, 2019 by hugh_a_graham340

So I'm working on building a custom python toolbox to aid the interpretation of a dataset we've created. 

 

The tool is simple it should extract key summary stats from the raster for a given area(s) defined by a polygon.

 

I've built the tool using Arc Pro and in this environment everythin works as expected. However, Our clients are still using ArcGIS so the tool must be cross compatible. When moving the tool across to ArcGIS 10.6 everything goes terribly wrong...

 

My first approach was to convert the raster to a numpy array and extract data from here - all very quick and easy. However, in ArcGIS numpy.nanmean would return a different value to Arc Pro and no matter what I did all calculatations on subsets returned zero. Additionally calculating numpy.std would crash due to memory error (I realise this is due to the the use of python 2 so less of an issue). 

 

So with numpy seemingly out I tried to use arcpy tools along these lines with raster properties and zonal histogram:

 

stdVal = arcpy.GetRasterProperties_management(raster, property_type="STD").getOutput(0) 

ZonalHistogram(shp, "OBJECTID", raster, histtab)

Once again, GetRasterProperties returns different values in ArcGIS than ArcPro 

Also the standard deviation property returns zero and all values calculated with zonal histogram are also zero.

 

So any reasons for this - Does my ArcGIS build have a broken version of numpy - I will try to run the tool on another machine and report back but currently have no access. Any advice would be much appreciated.

 

Cheers,

Hugh

Outcomes