Is This Content Helpful?
We're glad to know this article was helpful.
Why must arcpy.sa functions be assigned to a variable?
The arcpy.sa functions are temporary, therefore, the arcpy.sa function must be assigned to a variable. Otherwise, the output does not persist, and is unusable in scripts.
A variable holds references to data. In this example, the raster object created with an arcpy.sa function is stored in a variable named Solar.
from arcpy.sa import *;
arcpy.CheckoutExtension ("Spatial"); #Code used to check the extension in ArcMap
Solar = arcpy.sa.AreaSolarRadiation (inRaster, latitude, time);
# the code segment uses the arcpy.sa