Calculates geometric and positional properties of each cell in a raster dataset.
Usage
The following are example applications of the tool:
Calculate runoff, infiltration, and water balance metrics using the true geodesic area represented by each raster cell rather than assuming a constant cell area.
Conduct carbon, biomass, habitat, and other area-weighted environmental analyses by incorporating the true geodesic area of each raster cell into calculations.
Generate raster outputs with cell-center x- and y-coordinates that can be used as predictor variables in machine learning and spatial modeling workflows.
Assign unique row and column identifiers to raster cells for sampling, simulation, Monte Carlo, and cell tracking workflows.
Model edge effects and neighborhood interactions using the geodesic perimeter of each raster cell.
The Input Raster (in_raster in Python) parameter value can be integer or floating-point type.
If the All option or multiple options are selected for the Properties (properties in Python) parameter value, the output will be a multiband raster with one band for each requested property. Selecting any single property will output a single-band raster.
The band names in the Output Properties Raster (out_properties_raster in Python) value correspond to the properties they represent. These band names match the ArcPy property names.
You can view and use individual raster bands in the Output Properties Raster value in the following ways;
Open Layer Properties, and expand Band Metadata from the Source tab to view the bands.
Set the symbology of the Output Properties Raster value to Stretch, and select the band you want to display from the Band drop-down list.
In the Catalog pane, locate the output raster, and expand it to view the individual bands.
You can add the desired bands directly to the map from the Catalog pane or using the Add Data button. Optionally, create a group layer in the Contents pane, and add individual bands from the Output Properties Raster value to the group layer.
Use a single band as input to geoprocessing tools or map algebra expressions.
Outputs in .crf format do not show individual bands in the Catalog pane or when browsed to them. However, they can be viewed and used in the other ways mentioned above.
The Output Properties Raster value will contain the values of the requested properties for all cells, including the NoData cells within the extent of the input raster.
Multiband and multidimensional rasters can be used as input. However, the properties will be calculated using only the first band or slice of the input raster.
Cell X coordinate and Cell Y coordinate are in the units of the output coordinate system.
For the geodesic properties, the input raster or the output coordinate system must be either in a geographic coordinate system, or a projected coordinate system that has an associated geographic coordinate system.
For input rasters with rectangular cells, output formats .crf and Esri Grid are not supported.
This tool supports parallel processing. If your computer has multiple processors or processors with multiple cores, better performance may be achieved, particularly on larger datasets. The Parallel processing with Spatial Analyst help topic includes details about this capability and how to configure it.
By default, this tool will use up to 100 percent of the available cores. You can control the number of cores the tool uses with the Parallel processing factor environment.
The input raster for which the properties of the cells will be calculated.
Raster Layer
Properties
Specifies the cell properties to be calculated.
One or more properties can be selected from the list. Selecting the All option or multiple options for this parameter will create a multiband raster containing the requested properties in each band.
All—All of the properties will be calculated. This will create a multiband raster output.
Geodesic area—The geodesic area of each cell will be calculated.
Geodesic perimeter—The geodesic perimeter of each cell will be calculated.
Geodesic cell width—The geodesic width (cell size in the x direction) of each cell will be calculated.
Geodesic cell height—The geodesic height (cell size in the y direction) of each cell will be calculated.
Geodesic cell size—The average of the geodesic width and geodesic height of each cell will be calculated.
Cell X coordinate—The x-coordinate of the center of each cell will be calculated.
Cell Y coordinate—The y-coordinate of the center of each cell will be calculated.
Cell row index—The row index of each cell will be calculated. Index values start from 0, from the upper left corner.
Cell column index—The column index of each cell will be calculated. Index values start from 0, from the upper left corner.
String
Distance Unit
(Optional)
Specifies the unit that will be used to calculate distance.
Kilometers—The distance unit will be kilometers.
Meters—The distance unit will be meters. This is the default.
Statute Miles—The distance unit will be statute miles.
International Nautical Miles—The distance unit will be international nautical miles.
International Yards—The distance unit will be international yards.
International Feet—The distance unit will be international feet.
US Survey Miles—The distance unit will be US survey miles.
US Survey Nautical Miles—The distance unit will be US survey nautical miles.
US Survey Yards—The distance unit will be US survey yards.
US Survey Feet—The distance unit will be US survey feet.
String
Area Unit
(Optional)
Specifies the unit that will be used to calculate area.
Square Kilometers—The area unit will be square kilometers.
Hectares—The area unit will be hectares.
Square Meters—The area unit will be square meters. This is the default.
Square Statute Miles—The area unit will be square statute miles.
Square International Nautical Miles—The area unit will be square international nautical miles.
International Acres—The area unit will be international acres.
Square International Yards—The area unit will be square international yards.
Square International Feet—The area unit will be square international feet.
Square US Survey Miles—The area unit will be square US survey miles.
Square US Survey Nautical Miles—The area unit will be square US survey nautical miles.
US Survey Acres—The area unit will be US survey acres.
Square US Survey Yards—The area unit will be square US survey yards.
Square US Survey Feet—The area unit will be square US survey feet.
String
Return value
Label
Explanation
Data type
Output Properties Raster
The output cell properties raster.
This can be single band or multiband depending on the selected cell properties. The band names in the output raster correspond to the cell properties they represent.
The input raster for which the properties of the cells will be calculated.
Raster Layer
properties[properties,...]
Specifies the cell properties to be calculated.
One or more properties can be selected from the list. Selecting the All option or multiple options for this parameter will create a multiband raster containing the requested properties in each band.
ALL—All of the properties will be calculated. This will create a multiband raster output.
GEODESIC_AREA—The geodesic area of each cell will be calculated.
GEODESIC_PERIMETER—The geodesic perimeter of each cell will be calculated.
GEODESIC_WIDTH—The geodesic width (cell size in the x direction) of each cell will be calculated.
GEODESIC_HEIGHT—The geodesic height (cell size in the y direction) of each cell will be calculated.
GEODESIC_CELL_SIZE—The average of the geodesic width and geodesic height of each cell will be calculated.
X_COORDINATE—The x-coordinate of the center of each cell will be calculated.
Y_COORDINATE—The y-coordinate of the center of each cell will be calculated.
ROW_INDEX—The row index of each cell will be calculated. Index values start from 0, from the upper left corner.
COLUMN_INDEX—The column index of each cell will be calculated. Index values start from 0, from the upper left corner.
String
distance_unit
(Optional)
Specifies the unit that will be used to calculate distance.
KILOMETERS—The distance unit will be kilometers.
METERS—The distance unit will be meters. This is the default.
MILES_INT—The distance unit will be statute miles.
NAUTICAL_MILES_INT—The distance unit will be international nautical miles.
YARDS_INT—The distance unit will be international yards.
FEET_INT—The distance unit will be international feet.
MILES_US—The distance unit will be US survey miles.
NAUTICAL_MILES_US—The distance unit will be US survey nautical miles.
YARDS_US—The distance unit will be US survey yards.
FEET_US—The distance unit will be US survey feet.
String
area_unit
(Optional)
Specifies the unit that will be used to calculate area.
SQUARE_KILOMETERS—The area unit will be square kilometers.
HECTARES—The area unit will be hectares.
SQUARE_METERS—The area unit will be square meters. This is the default.
SQUARE_MILES_INT—The area unit will be square statute miles.
SQUARE_NAUTICAL_MILES_INT—The area unit will be square international nautical miles.
ACRES_INT—The area unit will be international acres.
SQUARE_YARDS_INT—The area unit will be square international yards.
SQUARE_FEET_INT—The area unit will be square international feet.
SQUARE_MILES_US—The area unit will be square US survey miles.
SQUARE_NAUTICAL_MILES_US—The area unit will be square US survey nautical miles.
ACRES_US—The area unit will be US survey acres.
SQUARE_YARDS_US—The area unit will be square US survey yards.
SQUARE_FEET_US—The area unit will be square US survey feet.
String
Return value
Name
Explanation
Data type
out_properties_raster
The output cell properties raster.
This can be single band or multiband depending on the selected cell properties. The band names in the output raster correspond to the cell properties they represent.
Raster
Code sample
CalculateRasterCellProperties example 1 (Python window)
This example shows how to how to calculate three cell properties from the input raster using the Calculate Raster Cell properties tool.
import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = r"C:\arcpyexamples\data"
out_raster = CalculateRasterCellProperties("elevation.tif",
"GEODESIC_PERIMETER;GEODESIC_WIDTH;GEODESIC_HEIGHT",
"METERS")
out_raster.save(r"C:\Out\elev_properties_out.tif")
CalculateRasterCellProperties example 2 (stand-alone script)
This example shows how to use the Calculate Raster Cell Properties tool to calculate all available cell properties from the input raster.
# Name: CalculateRasterCellProperties_standalone.py
# Description: Calculate cell properties of a raster.
# Requirements: Spatial Analyst extension
# Import system modules
import arcpy
from arcpy.sa import *
# Set environment settings
arcpy.env.workspace = r"C:\arcpyexamples\data"
# Set local variables
inRaster= r"C:\Data\my_ras.tif"
outRaster = r"C:\Out\ras_properties_out.tif"
properties = "ALL"
distanceUnits = "KILOMETERS"
areaUnits = "SQUARE_KILOMETERS"
# Run the tool
outPropertiesRaster = CalculateRasterCellProperties(
inRaster, properties, distanceUnits, areaUnits
)
# Save the output
outPropertiesRaster.save(outRaster)