Calculate Cell Size Ranges (Data Management)

Summary

Computes the minimum and maximum cell sizes for the rasters in a mosaic dataset.

Usage

Syntax

CalculateCellSizeRanges_management (in_mosaic_dataset, {where_clause}, {do_compute_min}, {do_compute_max}, {max_range_factor}, {cell_size_tolerance_factor}, {update_missing_only})
ParameterExplanationData Type
in_mosaic_dataset

Path and name of the mosaic dataset.

Mosaic Dataset; Mosaic Layer
where_clause
(Optional)

Define a SQL query if you only want to calculate the cell size ranges for a subset of the mosaic dataset items.

If no query is specified, all the mosaic dataset items will have their cell size ranges calculated.

SQL Expression
do_compute_min
(Optional)

Computes the minimum pixel size for all the rasters in the mosaic dataset.

  • MIN_CELL_SIZESComputes the minimum pixel size. This is the default.
  • NO_MIN_CELL_SIZESThe minimum pixel size is not computed.
Boolean
do_compute_max
(Optional)

Computes the maximum pixel size for all the rasters in the mosaic dataset.

  • MAX_CELL_SIZESComputes the maximum pixel size. This is the default.
  • NO_MAX_CELL_SIZESThe maximum pixel size is not computed.
Boolean
max_range_factor
(Optional)

The factor by which the high pixel size is multiplied by, to obtain the maximum pixel size value for the base rasters in the mosaic dataset. The default is 10.

Double
cell_size_tolerance_factor
(Optional)

Allows you to specify a cell size tolerance. This is useful when you have rasters with differing pixel sizes that should be considered the same. The default is 0.1.

Double
update_missing_only
(Optional)

Allows you to calculate only the missing cell size range values.

  • UPDATE_ALLCell size minimum and maximum values will be calculated for all rasters within the mosaic dataset. This is the default.
  • UPDATE_MISSING_ONLY Cell size minimum and maximum values will only be calculated if they do not exist.
Boolean

Code Sample

CalculateCellSizeRanges example 1 (Python window)

This is a Python sample for the CalculateCellSizeRanges tool.

import arcpy
arcpy.CalculateCellSizeRanges_management("c:/workspace/fgdb.gdb/md",
                                         "MIN_CELL_SIZES", "MAX_CELL_SIZES",
                                         "#", "#", "#")
CalculateCellSizeRanges example 2 (stand-alone script)

This is a Python script sample for the CalculateCellSizeRanges tool.

##===========================
##Calculate Cell Size Ranges
##Usage: CalculateCellSizeRanges_management in_mosaic_dataset {where_clause} {MIN_CELL_SIZES
##                                          | NO_MIN_CELL_SIZES} {MAX_CELL_SIZES
##                                          | NO_MAX_CELL_SIZES} {max_range_factor}
##                                          {cell_size_tolerance_factor} {UPDATE_ALL
##                                          | UPDATE_MISSING_ONLY}

try:
    import arcpy
    arcpy.env.workspace = "C:/Workspace"
    # Calculate the Mininum Cell Size and Maximum Cell Size with default setting
    arcpy.CalculateCellSizeRanges_management("Cellsize.gdb/md", "#", "MIN_CELL_SIZES",
                                             "MAX_CELL_SIZES", "#", "#", "#")
    
    # Change the Cell Size Range factor to use Source data pyramid
    # Change the Cell Size Tolerance factor to ignore the small difference
    # Only update the items that do not have cell size values
    arcpy.CalculateCellSizeRanges_management("Cellsize.gdb/md", "#", "MIN_CELL_SIZES",
                                             "MAX_CELL_SIZES", "100", "1"
                                             "UPDATE_MISSING_ONLY")
    
except:
    print "Calculate Cell Size Ranges example failed."
    print arcpy.GetMessages()

Environments

Related Topics

Licensing Information

ArcView: No
ArcEditor: Yes
ArcInfo: Yes

10/27/2014