Calculate Cell Size Ranges (Data Management)

Summary

Computes the visibility levels of raster datasets in a mosaic dataset based on the spatial resolution.

Usage

  • This tool automatically calculates the cell size ranges for the mosaic dataset items. The calculated cell size ranges are stored in the mosaic dataset attribute table in the MinPS and MaxPS columns. If you need to have specific values for the MinPS and MaxPS columns, you can edit these values manually.

  • You cannot calculate cell size ranges for a referenced mosaic dataset.

  • Database fragmentation and frequent data manipulation can significantly increase the size of a mosaic dataset. If the database size is large due to constant transactions, run the Compact tool.

Parameters

LabelExplanationData Type
Mosaic Dataset

The mosaic dataset to calculate the visibility levels for.

Mosaic Layer
Query Definition
(Optional)

An SQL expression to select specific rasters in the mosaic dataset on which to calculate visibility levels. If no query is specified, all the mosaic dataset items will have their cell size ranges calculated.

SQL Expression
Compute Minimum Cell Sizes
(Optional)

Compute the minimum pixel size for each selected raster dataset in the mosaic dataset.

  • Checked—Compute the minimum pixel size. This is the default.
  • Unchecked—Do not compute the minimum pixel size.
Boolean
Compute Maximum Cell Sizes
(Optional)

Compute the maximum pixel size for each selected raster in the mosaic dataset.

  • Checked—Compute the maximum pixel size. This is the default.
  • Unchecked—Do not compute the maximum pixel size.
Boolean
Maximum Cell Size Range Factor
(Optional)

Set a multiplication factor to apply to the native resolution. The default is 10, meaning that an image with a resolution of 30 meters will be visible at a scale appropriate for 300 meters. The relationship between cell size and scale is as follows:

Cell Size = Scale * 0.0254 / 96

Scale = Cell Size * 96 / 0.0254

Double
Cell Size Tolerance Factor
(Optional)

Use this to group images with similar resolutions as having the same nominal resolution. For example 1 m imagery and 0.9 m imagery can be grouped together by setting this factor to 0.1, because they are within 10% of each other.

Double
Update Missing Values Only
(Optional)

Calculate only the missing cell size range values.

  • Unchecked—Calculate cell size minimum and maximum values for selected rasters within the mosaic dataset. This is the default.
  • Checked—Calculate cell size minimum and maximum values only if they do not exist.
Boolean

Derived Output

LabelExplanationData Type
Updated Input Mosaic Dataset

The updated mosaic dataset.

Mosaic Layer

arcpy.management.CalculateCellSizeRanges(in_mosaic_dataset, {where_clause}, {do_compute_min}, {do_compute_max}, {max_range_factor}, {cell_size_tolerance_factor}, {update_missing_only})
NameExplanationData Type
in_mosaic_dataset

The mosaic dataset to calculate the visibility levels for.

Mosaic Layer
where_clause
(Optional)

An SQL expression to select specific rasters in the mosaic dataset on which to calculate visibility levels. If no query is specified, all the mosaic dataset items will have their cell size ranges calculated.

SQL Expression
do_compute_min
(Optional)

Compute the minimum pixel size for each selected raster in the mosaic dataset.

  • MIN_CELL_SIZESCompute the minimum pixel size. This is the default.
  • NO_MIN_CELL_SIZESDo not compute the minimum pixel size.
Boolean
do_compute_max
(Optional)

Compute the maximum pixel size for each selected raster in the mosaic dataset.

  • MAX_CELL_SIZESCompute the maximum pixel size. This is the default.
  • NO_MAX_CELL_SIZESDo not compute the maximum pixel size.
Boolean
max_range_factor
(Optional)

Set a multiplication factor to apply to the native resolution. The default is 10, meaning that an image with a resolution of 30 meters will be visible at a scale appropriate for 300 meters. The relationship between cell size and scale is as follows:

Cell Size = Scale * 0.0254 / 96

Scale = Cell Size * 96 / 0.0254

Double
cell_size_tolerance_factor
(Optional)

Use this to group images with similar resolutions as having the same nominal resolution. For example 1 m imagery and 0.9 m imagery can be grouped together by setting this factor to 0.1, because they are within 10% of each other.

Double
update_missing_only
(Optional)

Calculate only the missing cell size range values.

  • UPDATE_ALLCalculate cell size minimum and maximum values for selected rasters within the mosaic dataset. This is the default.
  • UPDATE_MISSING_ONLY Calculate cell size minimum and maximum values only if they do not exist.
Boolean

Derived Output

NameExplanationData Type
out_mosaic_dataset

The updated mosaic dataset.

Mosaic Layer

Code sample

CalculateCellSizeRanges example 1 (Python window)

This is a Python sample for the CalculateCellSizeRanges tool.

import arcpy
arcpy.CalculateCellSizeRanges_management(
     "C:/Workspace/cellsize.gdb/md", "#", "MIN_CELL_SIZES", 
     "MAX_CELL_SIZES", "20", "1", "UPDATE_MISSING_ONLY")
CalculateCellSizeRanges example 2 (stand-alone script)

This is a Python script sample for the CalculateCellSizeRanges tool.

# Calculate the Mininum Cell Size and Maximum Cell Size with default setting

import arcpy
arcpy.env.workspace = "C:/Workspace"

mdname = "cellsize.gdb/md"
query = "#"
calmin = "MIN_CELL_SIZES"
calmax = "MAX_CELL_SIZES"
maxfactor = "#"
tolerancefactor = "#"
updatemiss = "#"

arcpy.CalculateCellSizeRanges_management(
     mdname, query, calmin, calmax, maxfactor, tolerancefactor, updatemiss)