Snap raster


Snap raster is used to snap or align an extent during execution. The lower-left corner of the extent is snapped to a cell corner of the snap raster and then the upper-right corner is adjusted using the output cell size. As a result, when the output cell size is same as the snap raster cell size, the cells in the output raster are aligned with the cells of the snap raster.

Learn more about how Snap Raster works

Usage tips

Command line syntax

An overview of the command line window

SnapRaster <raster_dataset>


Parameters Explanation Datatype
<raster_dataset> The raster dataset to be used as the snap raster. Raster Dataset

Data types for geoprocessing tool parameters

Command line example

SnapRaster C:\data\mysnapraster

Scripting syntax

An overview of scripting in geoprocessing

SnapRaster raster_dataset


Parameters Explanation Datatype
raster_dataset (Required) The raster dataset to be used as the snap raster. Raster Dataset

Data types for geoprocessing tool parameters

Script example

import arcgisscripting
gp = arcgisscripting.create()

gp.workspace = "C:/workspace"
gp.extent = "C:/data/projectbnd"
gp.SnapRaster = "C:/data/mysnapraster"

try:
    # Set local variables
    InRaster = "C:/data/dem"
    OutRaster = "C:/data/aspect"

    # Check out ArcGIS Spatial Analyst extension license
    gp.CheckOutExtension("Spatial")

    # Process: Aspect
    gp.Aspect_sa(InRaster, OutRaster)

except:
    # If an error occurred while running a tool, then print the messages.
    print gp.GetMessages()

See Also