Select to view content in your preferred language

Geoprocessing, Int much slower than RasterCalculator

278
5
09-09-2025 11:45 AM
Kevin_Andras
Regular Contributor

I need to convert floating point rasters to integers.  Seemed logical to use the Int (Spatial Analyst) function.   

Turns out this sits around for 2 or 3 minutes (at 0% completed) before it even does the processing. 

When I do the same thing with a raster calculator expression, it takes 7 seconds. 

Same behavior whether I call this via my add-in or just executing geoprocessing tools.

 Any clue why Int takes forever?

Kevin_Andras_0-1757443276838.png

Kevin_Andras_1-1757443297580.png

 

0 Kudos
5 Replies
DanPatterson
MVP Esteemed Contributor

Interesting.  Perhaps it might have something to do with the optional Environment parameters that the Int tools supports

Int (Spatial Analyst)—ArcGIS Pro | Documentation

check to make sure that the cell size, extent etc is the same as the input float raster.

I also notice that the output raster type seems to be different in the examples that you provided (unless the first output name is truncated.)

Do the comparison with the same output type if this is not the case


... sort of retired...
0 Kudos
Kevin_Andras
Regular Contributor

I did try with different output types.  That makes no difference.  Good idea though.  

Environment settings were identical for both methods, too.

0 Kudos
DanPatterson
MVP Esteemed Contributor

are the raster attribute tables the same?


... sort of retired...
0 Kudos
Kevin_Andras
Regular Contributor

yes, output attribute tables, as well as all dataset properties, are exactly the same for the 2 outputs.

0 Kudos
DanPatterson
MVP Esteemed Contributor

a good case to report to Tech Support

It would be interesting if this is limited to Int or other SA tools and why the raster calculator circumvents what is slowing down things.

RasterToNumPyArray

use numpy to process values

NumPyArrayToRaster

is another option since they don't use arctoolbox just what is in arcpy/arcgisscripting


... sort of retired...
0 Kudos