[GIS] Need to get the minimum cell size of collection of rasters

arcgis-10.1modelbuilderraster

I have the following model in ModelBuilder:

Model

Get Raster Properties looks like this . . .
Get Raster Properties
I need to find the minimum cell size value to use as output. Any ideas on what tool I should use to replace Cell Statistics?
Thanks,
Renee


As I said above, the reason I need to get the minimum value of the cell size is because I need to create an empty output raster dataset that has compatible characteristics with the input rasters to be mosaicked together. However, I have another model that could get me around the above situation with having to create an output raster ahead of time. In the following model, I use "Mosaic to New Raster" rather than "Mosaic". This should work out well, but the output comes out crazy looking. Here is the model and the output . . .
Mosaic To New Raster Model

Result of Mosaic To New Raster

Best Answer

Try this to get minimum cell size for collection of rasters:

  1. Add the Calculate Value tool to your inner model (iterate selected rasters) after Collect Values.

  2. Connect the Collect Values output as a precondition to Calculate Value.

  3. Define a small function within Calculate Value (Code Block) as shown below.

    def minCellSize(rasters):
     rasterList = rasters.split(";")
     return min([arcpy.Describe(r).meanCellHeight for r in rasterList])
    
  4. Type this in the expression minCellSize("%Rasters%")

  5. Set Double as the data type

  6. Set the output from Calculate Value as a model Parameter (The output from Collect values remains a model parameter)

  7. Connect the Calculate Value output to the cell size variable of the Mosaic To New Raster tool.

Related Question